to get/set the actual selectedIndex property of the select element use:
$("#select-id").prop("selectedIndex");
$("#select-id").prop("selectedIndex",1);
More Related Contents:
- Prevent users from submitting a form by hitting Enter
- Click button copy to clipboard
- Selecting element by data attribute with jQuery
- Fancybox doesn’t work with jQuery v1.9.0 [ f.browser is undefined / Cannot read property ‘msie’ ]
- How can I get the button that caused the submit from the form submit event?
- How to limit the number of selected checkboxes?
- How to get header from cards or similar to have the same height with flex box?
- Is it possible to set async:false to $.getJSON call
- How to change options of with jQuery?
- Ajax.BeginForm in MVC to upload files
- jquery: change the URL address without redirecting? [duplicate]
- Submit form with Enter key without submit button? [duplicate]
- jQuery append fadeIn
- Error :Request header field Content-Type is not allowed by Access-Control-Allow-Headers
- jquery .live(‘click’) vs .click()
- jQuery hide element while preserving its space in page layout
- Is there a good jQuery Drag-and-drop file upload plugin? [closed]
- jQuery: How can I trigger an event when a div comes into view? [duplicate]
- JQuery, remove element from string
- How to add a trailing zero to a price with jQuery
- jquery remove plugin from element
- How can I programmatically change a select box selection from within the control’s own change event and have it work in mobile browsers
- jQuery: make checkboxes act like radio buttons?
- How to run a jquery function in Angular 2 after every component finish loading
- How to use getJSON, sending data with post method?
- Add slides to Bootstrap 3 carousel dynamically using jQuery
- Does Twitter Bootstrap include jQuery?
- submit disabled fields
- access model in javascript asp .net mvc razor
- jQuery – Detecting if a file has been selected in the file input [duplicate]