开发者

jQuery Xpath selector to select an element which id contains 'sometext'

开发者 https://www.devze.com 2022-12-16 08:43 出处:网络
I have a listbox element in aspx page which id is attributesList. I want to select this element to track its change event, but i cant directly select its id beca开发者_运维技巧use asp.net changes its

I have a listbox element in aspx page which id is attributesList.

I want to select this element to track its change event, but i cant directly select its id beca开发者_运维技巧use asp.net changes its id on runtime.

its id, attributesList changes into ctl00_adminPlaceHolder_attributesList.

so what i want to do is to use a "contains" xpath expression to select the element.


You'll want to instead use the "End with" attribute selector like so:

$("*[id$='attributesList']")
0

精彩评论

暂无评论...
验证码 换一张
取 消