开发者

<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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜