_霸王别姬
2018-12-19 15:11
<head>
<title>自定义类级别插件</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://www.imooc.com/data/jquery-1.8.2.min.js"></script>
<script src="https://www.imooc.com/data/jquery.twoaddresult.js" type="text/javascript"></script>
</head>
<body>
<div id="divtest">
<div class="title">
<span class="fl">自定义类级别插件</span>
<span class="fr">
<input id="btnCount" type="button" value="计算" />
</span>
</div>
<div class="content">
两数相减:
<input id="Text1" type="text" class="txt" />
-
<input id="Text2" type="text" class="txt" />
=
<input id="Text3" type="text" class="txt" />
</div>
</div>
<script type="text/javascript">
$(function () {
$("#btnCount").bind("click", function () {
$("#Text3").val(
$.subNum($("#Text1").val(),$("#Text2").val()
);
);
});
});
</script>
</body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>自定义类级别插件</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://www.imooc.com/data/jquery-1.8.2.min.js"></script>
<script src="https://www.imooc.com/data/jquery.twoaddresult.js" type="text/javascript"></script>
</head>
<body>
<div id="divtest">
<div class="title">
<span class="fl">自定义类级别插件</span>
<span class="fr">
<input id="btnCount" type="button" value="计算" />
</span>
</div>
<div class="content">
两数相减:
<input id="Text1" type="text" class="txt" />
-
<input id="Text2" type="text" class="txt" />
=
<input id="Text3" type="text" class="txt" />
</div>
</div>
<script type="text/javascript">
$(function () {
$("#btnCount").bind("click", function () {
$("#Text3").val(
$("#Text1").val()-$("#Text2").val());
});
});
</script>
</body>
</html>
<head>
<title>自定义类级别插件</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://www.imooc.com/data/jquery-1.8.2.min.js"></script>
<script src="https://www.imooc.com/data/jquery.twoaddresult.js" type="text/javascript"></script>
</head>
<body>
<div id="divtest">
<div class="title">
<span class="fl">自定义类级别插件</span>
<span class="fr">
<input id="btnCount" type="button" value="计算" />
</span>
</div>
<div class="content">
两数相减:
<input id="Text1" type="text" class="txt" />
-
<input id="Text2" type="text" class="txt" />
=
<input id="Text3" type="text" class="txt" />
</div>
</div>
<script type="text/javascript">
$(function () {
$("#btnCount").bind("click", function () {
$("#Text3").val(
$.subNum($("#Text1").val(),$("#Text2").val()
));
});
});
</script>
</body>
根据你的代码改的你对比一下
jQuery基础(五)一Ajax应用与常用插件
69100 学习 · 400 问题
相似问题