1.
1 <%@ page language="java" contentType="text/html; charset=UTF-8" 2 pageEncoding="UTF-8"%> 3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 4 <html> 5 <head> 6 <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> 7 <title>主页</title> 8 <link rel="stylesheet" href="common.css" type="text/css" /> 9 <script src="jquery-1.5.2.js" type="text/javascript"></script> 10 <script type="text/javascript"> 11 $(document).ready( function() { 12 $('p').addClass('highlight'); 13 //:contains 选择器选取包含指定字符串的元素。 14 $('p:contains(花朵)').text('草你妈'); 15 16 }); 17 </script> 18 </head> 19 <body> 20 <p> 21 我们都是祖国的花朵... 22 </p> 23 <div> 24 很傻很天真啊!!! 25 </div> 26 </body> 27 </html>