& lt; The input value="0" & gt; & lt; Button> & lt;/button>
Click on the button how to make the inside of the input value the value of the change
CodePudding user response:
JQuery
& lt; Input the id="inp" value="0" & gt; & lt; The button id="BTN" & gt; & lt;/button>
$(" # "BTN). Click (function () {
$(" # inp "). Val (" value ");
});
CodePudding user response:
& lt; Input the id="inp" value="0" & gt; & lt; Button onclick="f ()" & gt; & lt;/button>
JavaScript
The function f () {
Document. The getElementById (" inp "). The value="https://bbs.csdn.net/topics/value";
}
CodePudding user response: