<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>控制CSS样式</title> <style type="text/css"> @import url(../../CSS/1-4.css); </style> <script type="text/javascript" src="../../JQuery/jquery-2.1.4.min.js"></script> <script type="text/ecmascript"> $(function () { $("#divClick").click(function () { $(this).toggleClass("divClick").html("点击后的样式"); }) }) </script> </head> <body> <div id="divClick">点击前的样式</div> </body> </html>
时间: 2024-10-25 21:32:19