/ Published in: jQuery
Couldn't find a better way to do this, nor could I find it on teh interwebs, so here it is.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// for each select field on the page $("select").each( function(){ // set its value to its first option $(this).val( $("#" + $(this).attr("id") + " option:first").val() ); });