How can I determine the element type of a matched element in jQuery?

前端 未结 9 1329
鱼传尺愫
鱼传尺愫 2020-12-01 03:13

I\'m matching ASP.Net generated elements by ID name, but I have some elements which may render as text boxes or labels depending on the page context. I need to figure out wh

9条回答
  •  [愿得一人]
    2020-12-01 04:01

    First time I've answered my own question. After a little more experimentation:

    $("[id$=" + endOfIdToMatch + "]").each(function () {
       alert($(this).attr(tagName));
    });
    

    works!

提交回复
热议问题