Select an element with jQuery selector regardless of ID -
i have following code:
<div> <div id="someid"><h1>blah</h1></div> <div id="someid2"><h1>blah</h1></div> </div>
and trying select in jquery (for accordion in jquery ui). however, following not work unless remove id div.
$('> div > h1')
is there way tell selector ignore id, or going wrong way?
edit: actual use i'm going in sortable accordion in jquery ui, ids on div elements. example of i'm doing, source, can found here:
http://jqueryui.com/demos/accordion/#sortable
edit: have feeling may related jqueryui, rather selectors themselves, below code i'm trying run.
working example without id in div:
you try selecting <h1>
parent <div>
has id
attribute
$("div > div[id] > h1")
working example: http://jsfiddle.net/yjsvu/
ignores div
w/o id
: http://jsfiddle.net/yjsvu/1/
Comments
Post a Comment