Dear all I am using the jQuery. Now I need to classify the two lists
If any list having Id starts with outer i need to alert it Outer. If any list having Id starts with sub i need to alert it Sub.
<ul id="nav">
<li id="outer1"><a href="#url"><b class="">Outer 1</b></a></li>
<li id="outer2"><a href="#url"><b class="">Outer 2</b></a></li>
<li id="outer3"><a href="#url"><b class="">Outer 3 </b></a>
<ul style="display: none;">
<li id="sub1"><a href="#url"><span id="inner1"> inner1</span></a></li>
<li id="sub2"><a href="#url"><span id="inner2"> inner2</span></a></li>
</ul>
</li>
<li id="outer4"><a href="#url"><b class="">Outer 3 </b></a></li>
</ul>
My Code. I done the following code
$("li").each(function(){
$( "li[ @id ^= 'start' ]" )
alert("START");
$( "li[ @id ^= 'sub' ]" )
alert("SUB");
});
What change should i made in order to execute correctly