将一个文本框值添加到另一个文本框 [英] Adding one textbox value to another textbox

查看:124
本文介绍了将一个文本框值添加到另一个文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是JQuery的初学者,我想将一个textbox 值分配给另一个textbox.我已经为此编写了代码:

Hi all of you,

I''m a beginner in JQuery and I want to assign one textbox value to another textbox. I have written a code for that like:

<script type="text/javascript">
    $("#btnTest").click(function(event) {
        event.preventDefault();
        $("#txtLastName").val() = $("input:txtFirstName").val();
    });
</script>


但它不起作用.
有人可以帮我吗?
我正在等待您的回答.


but it''s not working.
Can anybody please help me through this?
I''m waiting for your answer.

推荐答案

(#btnTest").click(function(event){ event.preventDefault();
("#btnTest").click(function(event) { event.preventDefault();


(#txtLastName").val()=
("#txtLastName").val() =


("input:txtFirstName").val() ; }); < /script >
("input:txtFirstName").val(); }); </script>


但它不起作用.
有人可以帮我吗?
我在等你的答案.


but it''s not working.
Can anybody please help me through this?
I''m waiting for your answer.


这篇关于将一个文本框值添加到另一个文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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