How to make ? if me press the button (cal) , (input 2) is automatically filled with data ( input 1 ) 🙏 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to make ? if me press the button (cal) , (input 2) is automatically filled with data ( input 1 ) 🙏

<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <input type="number" placeholder="input 1"/> <input type="number" placeholder="input 2"/> <button> cal</button> </body> </html>

18th Aug 2022, 1:50 PM
Zulpakar
Zulpakar - avatar
4 Answers
+ 3
Check code to see how I make this, I placed comments so you can understand steps. https://code.sololearn.com/WQ5up2u0I9EP/?ref=app
18th Aug 2022, 3:15 PM
PanicS
PanicS - avatar
+ 1
Write a function that gets the value from 1 and sets it to 2 and attach it as click event to the button.
18th Aug 2022, 3:12 PM
Lisa
Lisa - avatar
+ 1
Thanks PanicS the code is working 🙏👌
18th Aug 2022, 3:29 PM
Zulpakar
Zulpakar - avatar
+ 1
Thanks for advice Lisa 🙏
18th Aug 2022, 3:31 PM
Zulpakar
Zulpakar - avatar