views:

208

answers:

2

Dear expert, 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>
</ul>
+1  A: 
$('#tab_close')

...if, by selecting, you mean getting the jQuery object representing that node.

Tgr
Without any more information from the OP about any specific problem, this IS the correct answer. Case closed.
Sune Rasmussen
I already try $('#tab_close') but don't work.
MHB
A: 

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");
Mike