![](/img/trans.png)
[英]How to show a input text field when a value is entered in input number type field in javascript?
[英]Javascript, How to show two value into same input type text field?
我想在單個輸入類型的文本中顯示10 20,但是下面的選項不起作用。 誰能幫我
Javascript:-
var a = 10;
var b = 20;
document.getElementById("current").value = a , b;
HTML:-
<input type="text" id="current">
試試document.getElementById("current").value= a +" " + b;
根據您的問題,只需使用以下命令來連接兩個值。
var a = 10;
var b = 20;
document.getElementById("current").value = a+" "+b;
您可以執行以下操作:
document.getElementById("current").value = a + " " + b;
嘗試這個 :
var a = 10;
var b = 20;
document.getElementById("current").value = ""+a +" "+b;
希望能幫助到你!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.