最近学jQuery遇到些小问题。求助~
这是我刚写的一段代码,我预期单击button会有一个alert弹出。但是任何反应都没有。
而且我在$(document).ready(function()下加了一个alert。预期打开界面时会有一个alert。然而也没有。
求大家看一下。
代码:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="js/jquery-1.8.0.js"></script>
<script type="text/javascript">
$(document).ready(function(){
alert("ss");
$(":button").click(function(){
alert("ss");
});
});
</script>
</head>
<body>
<input type="button"/>
<input type="button" />
<button >ss</button>
<button >sss</button>
</body>
</html>
而且我在$(document).ready(function()下加了一个alert。预期打开界面时会有一个alert。然而也没有。
求大家看一下。
代码:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="js/jquery-1.8.0.js"></script>
<script type="text/javascript">
$(document).ready(function(){
alert("ss");
$(":button").click(function(){
alert("ss");
});
});
</script>
</head>
<body>
<input type="button"/>
<input type="button" />
<button >ss</button>
<button >sss</button>
</body>
</html>
...全文
相关推荐
Jquery最近仿淘宝最近浏览
Jquery 仿淘宝最近浏览的功能 (包括图片和CSS)
jQuery cookie插件来做最近浏览
jQuery cookie插件来做最近浏览,打开后刷新页面,会出现浏览过的商品。保存了最近浏览的6件商品。
jQuery实现查找最近父节点的方法
主要介绍了jQuery实现查找最近父节点的方法,涉及jQuery针对元素节点操作的相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下
从零开始学jquery
从零开始学jquery,一个非常好的教程!!!
Jquery 最近浏览过的商品的功能实现代码
[removed][removed] //与Prototype 类似的框架 [removed][removed] //插件 代码如下: /*JCookie.js * / jQuery.cookie = function(name, value, options) { if (typeof value != ‘undefined’) { // name and value given, set cookie options = o


