I am trying to figure out the most efficient way to find my element. Following i smy structure:
相关标签:
Remove the space:
$("div.a[customattrib='2']")
By putting in the space, you're making it into a descendant selector which finds all elements that match [customattrib='2'] and are inside an element that matches div.a.
[customattrib='2']
div.a