Hi may I pleas know how to perform an if else code using data from text box | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hi may I pleas know how to perform an if else code using data from text box

I would want to know how to perform an if else code using java and javascript using data from text box For example when the user places an input of hi then the code will print "hello how are you?" So for example:if input=hi Print"hello how are you" 😀THANK YOU😀

28th Mar 2020, 11:38 AM
Prajay Nitin
Prajay Nitin - avatar
1 Answer
+ 1
There is a window.prompt method in js which you can use to take input. If you need to take input from <input> tag select it using DOM selector methods and then use `value` property of returned input element. Just continue your JS course , keep writing code and you'll understand it. This is very simple code learn and try doing yourself. If you get errors ask here.
28th Mar 2020, 11:47 AM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar