retrieve ID of server control using jQuery

前端 未结 6 1255

How do I get the ID of a server control with jQuery?

E.g. I have

a

6条回答
  •  一个人的身影
    2020-12-11 05:38

    Labels render as span tags. So if you want to select all the Labels:

        $(document).ready(function()
        {
            $Labels = $("span");
    
            $Labels.each(function()
            {
                alert(this.id); 
            });
        });
    

提交回复
热议问题