添加不在jquery中工作 [英] Addition not working in jquery

查看:70
本文介绍了添加不在jquery中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

添加不在jquery中工作....我正确地添加了jquery文件,但它的添加不起作用

Addition not working in jquery....i added jquery file correctly but its addition not working

<html>
<head>
<script type="text/javascript" src="jquery-1.12.1.min.js"></script>
<script type="text/javascript" >
$(document).ready(
function(){
$("#sub").click(
 
 var a=$("#txfirstno").val;
 var b=$("#txsecondno").val; 
  $("#result").val(a+b);
  
  );})

</script>
</head>
<body>
<form Name="vontact"id="main">
First NO:<input type="text" id="txfirstno"/></br>
Second No:<input type="text" id="txsecondno"/></br>
Answer:<input type="text" id="result"/></br>
<input type="button" id="sub" text="ok"/></br>
</form>
</body>
</html>





我的尝试:



i正确地添加了jquery文件,但它的添加不起作用。



What I have tried:

i added jquery file correctly but its addition not working.

推荐答案

document ) .ready(
function (){
(document).ready( function(){


#sub)。点击(

var a =
("#sub").click( var a=


#txfirstno)。val;
var b =
("#txfirstno").val; var b=


这篇关于添加不在jquery中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆