0

info

Can you explain i am little bite confuse in this try it yourself https://www.sololearn.com/Play/JavaScript according sololearn didnt mention to add open <html> and <head> <body> <script> and close it I logically did it but using Atom to code i could close the color in atom of </html> </body> </script> didnt become red instead blue If you know ATOM by the way <head> </head> <body> <form onsubmit="return validate()" method="post"> Number: <input type="text" name="num1" id="num1" /> <br /> Repeat: <input type="text" name="num2" id="num2" /> <br /> <input type="submit" value="Submit" /> </form> <script> function validate(){ var n1 = document.getElementById("num1"); var n2 = document.getElementByld("num2"); if(n1.value!=""&& n2.value!= "") { if(n1.value = = n2.value) { return true; } } alert("The values should be equal and not blank "); return false; </script> </body> </html>

11th Aug 2017, 8:07 AM
Michael Tuninetti
Michael Tuninetti - avatar
1 Antwort
+ 7
you said try it yourself in SoloLearn didn't mention to add open and close <html>, <head>, <body>, and <script> tag. but when you use ATOM you must add it. the answer: try to make the code you said without use <html>, <head>, <body>. it will work the red color in your text editor not showing an error. I don't know ATOM, 'cause I use notepad++
11th Aug 2017, 10:04 AM
Amethyst Animion
Amethyst Animion - avatar