$(this + "option:selected").attr("rel") option selected is not working in IE - jQuery … In this article, I am going to show you a very easy and simple way to get selected option index value using jQuery.And the actual code is just 1 line, so it’s super easy to follow and implement. Pleas mdbootstrap-team. Stack Overflow for Teams is a private, secure spot for you and With help of code we can set the Select Options selected value by using jQuery . At times, it could be very useful to use jQuery to Get Selected Option Index value for carrying out relevant processing. Hi guys, I have these two dropdown lists, the second one dynamically filling from a MySQL DB depending on the selection of the first dropdown list. For all intents and purposes, when changing values that the user has the ability to change .. especially boolean values, you should use .prop. Reason : jQuery 1.6 introduced the .prop() method for setting or getting properties on nodes and deprecated the use of .attr() to set properties. 1. However, versions up to 1.9 continued to support using .attr() for specific situations. I appreciate it. The problem is that it doesn't fire an 'onchange' event. Note: If the drop-down list allows multiple selections it will only return the index of the first option selected. Note that the above example will not work if you are reading this in a feed reader. {"z2941604":[14737000000995074,14737000000995111],"z3125715":[14737000000994128,14737000000994134,14737000000994168,14737000000994257],"z30317085":[14737000004833023]}. your coworkers to find and share information. However, versions up to 1.9 continued to support using .attr() for specific situations. Example Here (defaults to jQuery 1.4): http://jsfiddle.net/reigel/TZmEw/. However, something other than adding the custom-red class has happened here, which isn't imm… Is Harry Potter the only student with glasses? Additional Notes. I have side-bar.html file, fragments from which are used in other HTML files to avoid rewriting the code. What does a faster storage device affect? Asking for help, clarification, or responding to other answers. What was the name of this horror/science fiction story involving orcas/killer whales? version added: 1.0 jQuery( ":not(selector)" ) selector: A selector with which to filter by. Topic: JavaScript / jQuery Prev|Next. Now, whenever the dialog applies the ui-dialog class name, it will also add a custom-red class name. How to advise change in a curriculum as a "newbie", True mental potential of an enlightened human. 3. jQuery not working on 2nd page of SharePoint list. Thanks to all who tried to help me. Thank you! Open IE6 Select element with no option element like '' on the html. Similarly, it's probably better to use .val to set the