abstract:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>下划线跟随</title> <script type="text/javascript" src="js/jqu
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>下划线跟随</title> <script type="text/javascript" src="js/jquery-3.3.1.js"></script> <style type="text/css"> *{margin: 0px;padding: 0px;} li{list-style: none;float: left;margin: 1px;background: blue;width: 120px;height: 40px;line-height: 40px;text-align: center;} .line{border-bottom: 2px solid red;} </style> </head> <body> <script type="text/javascript"> $(document).ready(function(){ $('li').mouseover(function(){ $(this).addClass('line') }) $('li').mouseleave(function(){ $(this).removeClass('line') }) }) </script> <div> <ul> <li>啦啦啦啦啦啦</li> <li>啦啦啦啦啦啦</li> <li>啦啦啦啦啦啦</li> <li>啦啦啦啦啦啦</li> <li>啦啦啦啦啦啦</li> <li>啦啦啦啦啦啦</li> </ul> </div> </body> </html>
Correcting teacher:查无此人Correction time:2019-04-03 13:26:12
Teacher's summary:完成的不错。js每行代码结束后,要增加;号。继续加油。