The jquery text of method takes the text in the tag

  • 2020-03-30 03:35:33
  • OfStack

<span id="236" class="active" type="teacher" ww="nn">
<input type="checkbox" onclick="event.cancelBubble=true;">
 liu 4
</span>

Get the text "liu 4"
Get the id


$("input:checked",".simpleTree").each(function(){
var currentNode = $(this).parent(); 
var isfolder = currentNode.text(); 
var id=currentNode.attr("id")
alert(isfolder); 

});

Related articles: