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
Post a Comment