+ 1

what is the error?

the code: <!DOCTYPE html> <html> <head> <script> while(true){ var box = getElementById('text'); var input = getElementById('in') var text = box.val(); text.innerHTML(input.charCodeAt()); } </script> </head> <body> <textarea id="in" style="margin: 0px; width: 1182px; height: 253px;"></textarea> <br> <textarea id="text" style="margin: 0px; width: 1181px; height: 60px;"></textarea> </body> </html> it says Uncaught ReferenceError: getElementById is not defined Line: 3

5th Sep 2017, 11:08 AM
Matthew Li
Matthew Li - avatar
5 Respuestas
+ 3
Remember the ; behind too
5th Sep 2017, 11:58 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
it should be document.getElementById('text') and document.getElementById('in')
5th Sep 2017, 11:12 AM
Kartikey Sahu
Kartikey Sahu - avatar
+ 2
@Li PLEASURE.
5th Sep 2017, 11:51 AM
Kartikey Sahu
Kartikey Sahu - avatar
+ 1
thanks
5th Sep 2017, 11:47 AM
Matthew Li
Matthew Li - avatar
+ 1
@$ I don't think it is necessary for JS
5th Sep 2017, 12:00 PM
Kartikey Sahu
Kartikey Sahu - avatar