This will probably sound silly, but I want to optimize my jQuery code in order to achieve something like this:
jQuery("#myid).{ // Here, how can I make it work?
var value = jQuery(this).val();
if(value == null || value == ""){
jQuery(this).addClass("error");
}
// and so on
}
Basically, I want to select a DOM element and apply various codes to it. How can I do it?