开发者

How to Reset data inserted into Inputbox Using Javascript

开发者 https://www.devze.com 2023-03-06 01:59 出处:网络
I`m Learner Thank you all for helping me :) How can i reset all the inputbox by having reset function button which give the ability to re-enter the original number to the inputbox, for example i want

I`m Learner

Thank you all for helping me :)

How can i reset all the inputbox by having reset function button which give the ability to re-enter the original number to the inputbox, for example i want to add this number when reset button click = 2

when i type for example 50 and now like to have a button so when clicked number 2 replaced into that input box.

here what i have done so far. please check.

http://jsfiddle.net/eSUSA/

Appericiate for any reply and 开发者_如何学编程help


If you are in a form you can make an input of type="reset".

So just change your button to:

<input type="reset" value="Reset">


just add the default values to each element using the value attribute and have reset button, don't forget the form

<form id="myForm">
    <input name="t1" type="text" size="1" id="t1" value="2"/>
    <input type="reset" value="Reset"/>
</form>
0

精彩评论

暂无评论...
验证码 换一张
取 消