I have a ul:
<ul>
<li>1</li>
<li><a href="#">2</a></li>
</ul>
I need a thing that I want to make first li to anchor means
<li>1</li>
to
<li><a href="#">1</li></li>`
and remove anchor from 2nd means
<li><a href="#">2</a></li> to <li>2</li>
How can I do this in jQuery?
Very simple method, that “toggles” the links:
Example: http://jsfiddle.net/E2ryt/
Update:
From your comment I think you want this:
But I’m not 100% sure. See here: http://jsfiddle.net/E2ryt/1/
Update 2:
Based on David’s comment, you might want this:
See here: http://jsfiddle.net/E2ryt/2/