Error in JS code

Hi,
I was trying to make a code in sublime text editor to print the message in main body instead of giving alert using getElementBYId method as taught in the training but I GOT AN ERROR IN LINE 13 OF THE CODE GIVEN BELOW:


CAN ANYONE TELL ME THE CORRECT CODE TO DO THIS TASK.

@rajputsafal27

Correction - Id instead of ID , smalll letter D. in document.getElementById

Let me know if you have any other query.

2 Likes

hi, to get the correct output, kindly replace document.getElementByID with document.getElementById

you need to do a correction = document.getElementById
instead of D use d;Hope this solves your query.