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 -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -