javascript和jquery比较
2024-09-03 17:03:01
<h1>我的第一段 JavaScript</h1>
<p>请输入数字。如果输入值不是数字,浏览器会弹出提示框。</p>
<input id="demo" type="text">
<script>
function myFunction()
{
var x=document.getElementById("demo").value;
if(x==""||isNaN(x))
{
alert("Not Numeric");
}
}
</script>
<button type="button" onclick="myFunction()">点击这里</button>
</body>
</html>
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".btn1").click(function(){
$("p").slideToggle();
});
});
</script>
</head>
<body>
<p>This is a paragraph.</p>
<button class="btn1">Toggle</button>
</body>
</html>
最新文章
- Spring-data-jpa 的@modifying注解
- js中的什么时候需要用new来实例化?
- url编码 中文在url参数中传递,在请求头,响应头中传递,是如何编码的呢?
- Jdeveloper 太慢 slowly
- BZOJ 1042 硬币购物(完全背包+DP)
- Android 热补丁动态修复框架小结
- Teaching Your Computer To Play Super Mario Bros. – A Fork of the Google DeepMind Atari Machine Learning Project
- PSP0表格二
- linux 压缩文件 及压缩选项详解
- z-index兼容问题:关于ie6/7下的z-index
- nandsim ubi nand nor
- css2实现尖角箭头式导航
- C# 验证识别基类
- HDU 3304 Interesting Yang Yui Triangle lucas定理
- 1.如何安装matlab2016a
- Objectiv-C UIKit基础 NSLayoutConstraint的使用(VFL实现)
- c#读取Excel数据到Gridview
- nexus 数据库备份任务webhook 通知
- MySQL指令
- mysql主从(主备)同步一键配置,配自动检测功能