jQuery基础——jQuery的常用方法

一、$介绍

1、$就是jQuery的简写。

<body>
<input type="submit" value="按钮">

<script src="../script/jquery.js"></script>
<script>
jQuery("input").click(function () {
console.log("hello world");
})
</script>
</body>

2.$获取到的结果是一个jQuery对象。

<body>
<input type="submit" value="按钮">

<script src="../script/jquery.js"></script>
<script>
jQuery("input").click(function () {
// console.log("hello world");
console.log($("input"));
})
</script>
</body>
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《jQuery基础——jQuery的常用方法》
文章链接:https://zhuji.vsping.com/4612.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。