jQuery基本语法学习总结

原创 2018-10-31 21:49:03 271
摘要:<!DOCTYPE html> <html> <head>     <meta charset="utf-8">     <title>jQuery基本语法</title>    
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>jQuery基本语法</title>
    <script type="text/javascript" src="前端课件/jQuery/jquery-3.3.1.min.js"></script>
<body>
    <script type="text/javascript">
         $(document).ready(function(){
            $("div").hide();
               $("button").click(function(){
                   $("div").show();
               })
         })
    </script>
    <div  style="width: 100px;height: 100px;border:1px solid #888;background-color: #ccc;"></div>
    <button>按钮</button>
</body>
</html>

jQuery需要下载,引用方法和script外部引用方法一样,$(document).ready()基础结构,预防函数未加载完毕就执行,基本语法法:$(selector).action(function(){}),学习jQuery前必须掌握这些基本结构和基本语法,为后期的学习打好基础。

发布手记

热门词条