1.介绍
2.程序
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Insert title here</title> 6 <script type="text/javascript" src="jquery-3.2.1.min.js"></script> 7 <script type="text/javascript"> 8 $(function(){ 9 //remove 10 $("#rl").remove(); 11 12 $("#city li").click(function(){ 13 $(this).remove(); 14 }); 15 16 //empty 17 alert(1); 18 $("#game").empty(); 19 }) 20 </script> 21 </head> 22 <body> 23 <p>你喜欢哪个城市?</p> 24 <ul id="city"> 25 <li id="bj" name="BeiJing">北京</li> 26 <li>上海</li> 27 <li id="dj">东京</li> 28 <li id="se">首尔</li> 29 </ul><br> 30 31 <p>你喜欢哪款单机游戏?</p> 32 <ul id="game"> 33 <li id="rl">红警</li> 34 <li>实况</li> 35 <li>极品飞车</li> 36 <li>魔兽</li> 37 </ul> 38 </body> 39 </html>