select value of 2 html select element witht the jquery -


i have situation have select dropdown value this

$(this).parent().parent('div').find('option:selected').val(); 

later realized need put 2nd ddl there in same div, become confuse how fetch value of each of ddl. there way apply id code

$(this).parent().parent('div').find('option:selected').val(); 

so can fetch each.

following code first ddl.

<select style="width:30px" name="ddlqty" id="ddlqty" class="positive-integer"><option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> </select> 

and second

<select name="optionid" id="optionid"><option value="14">5''  £25.00</option> </select> 

how can select each of value?

for fisrt one:

$(this).parent().parent('div').find('#ddlqty option:selected').val(); 

and second one:

$(this).parent().parent('div').find('#optionid option:selected').val(); 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -