(013)jquery_filter_过滤选择器contains
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>f_html.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!--<link rel="stylesheet" type="text/css" href="./styles.css">--> <style type="text/css"> ol { float: left; width: 180px; } ol li { float: left; width: 180px; height: 23px; line-height:23px; margin: 2px 0px; } </style> <script type="text/javascript" src="../js/jquery/jquery190.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("li:contains('jQuery')").css("background-color","pink"); }); </script> </head> <body> <div>改变包含"jQuery"字符内容的背景色:</div> <ol> <li>强大的"jQuery"</li> <li>"javascript"也很实用</li> <li>"jQuery"前端必学</li> <li>"java"是一种开发语言</li> <li>前端利器——"jQuery"</li> </ol> </body> </html>
***万事万物都有裂痕,那是光照进来的地方***

浙公网安备 33010602011771号