开发者

<span> tag selection problem within anchor using jquery

开发者 https://www.devze.com 2022-12-29 11:21 出处:网络
I have facinga problem to select span tag using jquery. Please give a solution. code: <ul> <li>

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

精彩评论

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