Here I am going to show you some example with explanation that how to change a dropdown box value in jquery.
Suppose I have html element having select dropdown and I want to change the dropdown selected value on some change event.Also I can set dropdown value
value manually when I want or where I want.In the same I can get the selected value and its text or label value through jQuery.
So I have shown on below with some examples please check below details for working on dropdown select box.
Here I have a simple select /dropdown box having id=”name” and more number of options having values as well as labels/text.
Before doing everything your site needs contain latest jQuery plugin unless below examples won’t work.
1) To get slected dropdown value:
2) To set dropdown value to your name ‘Jyoti’.
3) To set dropdown value to another name ‘Jyotiranjan’.
4) To disable jyotiloppy option in dropdown down box.
5) To enable jyotiloppy option in dropdown down box.