/ Published in: jQuery
Expand |
Embed | Plain Text
// Get the value of the selected item $("#ComboBox").val() // Get the text of the selected item $("#ComboBox option:selected").text() // Find out when the select value changed $("#ComboBox").change(function() { /* do something here */ }); // Programmatically set the selected item $("#ComboBox").val(2); // Clear the list $("#ComboBox").html(""); // Add to the list: $("<option value=’9’>Value 9</option>").appendTo("#ComboBox"); // Select All options $('fieldset select option').attr('selected','selected');
You need to login to post a comment.
