Find all labels that end with SXS

I am trying to find all labels that ends with "SXS" I am using the following jquery statement

<label id=" + counter + "MKUPDNSXS for="+counter+"SXS></label>

 $("label[for$='SXS']").each(function () {
            alert(this.name);
        });

but this is returns undefined , I am using the same statement to find all inputs and it works find !
 $("input[name$='SXS']").each(function () {
            alert(this.name);
        });
UKITAsked:
Who is Participating?
 
Rainer JeschorCommented:
Hi,
the problem is that the propery name is undefined for your labels.
This works:
$(document).ready(function() {
  $("label[id$='SXS']").each(function () {
             alert($(this).attr("id"));
         });

});

Open in new window

Sample:
http://jsfiddle.net/EE_RainerJ/ja21nujg/
HTH
Rainer
0
 
UKITAuthor Commented:
Thank you that is great, thanks a lot
0
 
Rainer JeschorCommented:
Hi,
you are welcome. Thanks for accepting the solution - no. 1500 - lets celebrate

BR
Rainer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.