<span> tag selection problem within anchor using jquery
I have facing a problem to select span tag using jquery. Please give a solution. code:
<ul>
<li>
<a href="#Document1">Document 1
<span id="tab_close> x </span>
</a>
</li&开发者_JAVA百科gt;
</ul>
$('#tab_close')
...if, by selecting, you mean getting the jQuery object representing that node.
I would recommend not using jQuery if all you're doing is selecting an element by id. No need to include the framework for something built into Javascript.
document.getElementById("tab_close");
you forgot to close the id
<span id="tab_close"> x </span>
精彩评论