Remove the jquery code for the node

  • 2020-03-30 01:23:02
  • OfStack

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ""> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<script type="text/javascript" src="jquery-1.7.2.js"></script> 
<script type="text/javascript"> 
//Node movement
//The remove method returns the jquery object of the removed node
//var removeLi = $("ul li:eq(3)").remove(); 
//$("ul li").remove("li[title != 2]"); 

//Empty the contents of the element
$("ul li:eq(3)").empty(); 
<p title="hello world"> What do you think of the training in shengsi park? </p> 
<li title="1"> good </li> 
<li title="2"> Very good </li> 
<li title="3"> Very good </li> 
<li title="4"> Very good </li> 
<li title="5"> Too good </li> 
<li title="6"> Good beyond description </li> 

Related articles: