Error in the html code for LED control

Please help me debug the error in the code. ( as depicted in the screenshot).

This code in a html file not javascript .So you should save it by .html extension.

1 Like

please change the extension of file js to html because this code file is html not a java script

@ rjain249403 i can see that you have developed a code for controlling your LED. For that you have decided to code using HTML language. After writing down the code, you are supposed to save the code using its own extension. HTML files should be saved with a .html extension and not anything else. But you have saved it with a .js extension. This has to be changed to “html” extension which would be available in the drop-down options itself. I hope this helps you.

The code you have typed is an HTML code and therefore you must save the code with the appropriate extension used for the particular programming language. You must save the above file with either “.html” or “.htm” extension.