Solution var selectedid=$("#dropdownname").find('option:selected').attr('id'); Explanation This will find the id of selected dropdown option and store it in the variable selectedid.
Say Bye to Bugs
Solution var selectedid=$("#dropdownname").find('option:selected').attr('id'); Explanation This will find the id of selected dropdown option and store it in the variable selectedid.