按按钮在输入框上显示(按钮中的值)。 [英] Press Button to display (the value in the button) on the Input Box.

查看:78
本文介绍了按按钮在输入框上显示(按钮中的值)。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立一个程序,你有一个输入框和一个按钮,当用户按下按钮时,按钮值会显示在输入框上。我尝试过以下方法:

I''m building a program where you have an input box and an button, when user presses the button, the button value is displayed on the input box. I''ve tried the following:

展开 | 选择 | Wrap | 行号

推荐答案

Heya,Divina。


你遇到的问题是,当你使用parseInt()时,你不再使用对x'值的引用;相反,你正在使用它的副本。


为了使这项工作,你会想做这样的事情:
Heya, Divina.

The problem you''re having is that when you use parseInt(), you''re no longer working with a reference to x''s value; instead you''re using a copy of it.

To make this work, you''ll want to do something like this:
展开 < span class =codeDivider> | 选择 | Wrap | Line数字


Acoder,我已经尝试了你所说的但仍然没有用,你能看到我的编码吗,(谢谢你的快速回复):


Acoder, I''ve tried the what you said and still it didn''t work, Can you see my coding below, (thank you for your quick response):


展开 | 选择 | 换行 | 行号


Heya,Divina。


Hm。好吧,试试这个:
Heya, Divina.

Hm. Ok, try this:
展开 | 选择 | Wrap | 行号


这篇关于按按钮在输入框上显示(按钮中的值)。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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