0

I have two or more dropdown lists

<select id='ddl1'>
    <option>aa</option>
    <option>bb</option>
    <option>cc</option>
    <option>dd</option>
<select>

<select id='ddl2'>
    <option>aa</option>
    <option>bb</option>
    <option>cc</option>
    <option>dd</option>
<select>

I want to retrieve the selected values from both ddl.

My current code:

myvalues = $('select[id^=ddl]').val();

What am i doing wrong?

j0lt_
  • 13
  • 2

1 Answers1

0

Try myvalues = $(‘select[id^=“ddl”]’).val();

Harnam Singh
  • 64
  • 1
  • 6