/ Published in: jQuery

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//If div option "Selected Text" is selected, display test. $("#div").change(function() { if (($("option:selected", $(this)).attr("value")=="Selected Text")) { $("#div2:hidden").show(); $('#div2').addClass('inputclass pageRequired'); } else { $('#div2').removeClass('inputclass pageRequired'); $('#div2').removeClass('warning'); $("#div2:visible").hide(); } });
Comments
