I have a select field with some options in it. Now I need to select one of those options with jQuery. But how can I do that when I only know the
Try this. Simple yet effective javaScript + jQuery the lethal combo.
SelectComponent :
Selection :
document.getElementById("YourSelectComponentID").value = 4;
Now your option 4 will be selected. You can do this, to select the values on start by default.
$(function(){
document.getElementById("YourSelectComponentID").value = 4;
});
or create a simple function put the line in it and call the function on anyEvent to select the option
A mixture of jQuery + javaScript does the magic....