Posted in Javascript onMarch 16, 2011
完整代码:
<!DOCTYPE html> <html> <head> <style type="text/css"> .highlight { background-color: yellow; } .gray { background-color: Gray; } </style> <script src="http://code.jquery.com/jquery-1.5.js"></script> </head> <body> <ul> <li>Look:</li> <li>This is some text in a paragraph.</li> <li>This is a note about it.</li> </ul> <script type="text/javascript"> $("ul li").first().addClass('highlight'); jQuery("ul li").first().next().addClass('gray'); </script> </body> </html>
初识JQuery 实例一(first)
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@