jQuery控制CSS样式

<!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>

 

posted @ 2015-07-28 09:19  赵孟蒙  Views(126)  Comments(0Edit  收藏  举报