How I can use a class name here in jQuery -


i want use labels contains myclass

if ($(field).val() != ""){   var fieldid = $(field).attr("id");   $("label[for='"+fieldid+"']").hide(); } 

the above code useful put id, how can use classes?

  var myclass = "yourclass";   $("label." + myclass).hide(); 

the jquery selector $() takes strings equivalent css1-3 selectors (plus few others). if can select via css can select via jquery.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -