Regarding turning on led using html

Dear sir,
I am not able to figure out why the html code written is not working
Code and circuit diagrams are attached :point_down:



But if I change to javascript and execute it led is working for same hardware connections.
In light of above issue i request you to reply at your earliest convenience.
Thanking you,
Yours sincerely,
Akhilesh.

Now it’s showing some error in code which I am not able to debug
Here is the error below :point_down:

Hi @me23btech11058

Please share the entire code with us(no screenshots). This will enable us to guide you better with a proper solution.

here is entire code below

Led Controller

i am trying to share the code but only images are only shared to you sir but if i click on edit it showing my entire code.

Hi @me23btech11058

Please Go to your code editor , copy the code and paste it here, in the forum box using code block ( </> icon). The code snippet will help us to debug the error .

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Led Controller</title>
	<script type="text/javascript">
		setKey('{{ApiKey}}','{{Name}}');
	</script>
</head>
<body>
	<p id="led-off" onclick="led_off()">
		<img src="https://media.istockphoto.com/id/185206958/photo/light-bulb.jpg?s=612x612&w=0&k=20&c=uff31Cf5Qy0Rss2OBw7aOysvoDEVKJVk53PrLfzGpBI=">
	</p>
	<p id="led-on" onclick="led_on()">
		<img src="https://cdn5.vectorstock.com/i/1000x1000/60/94/cartoon-glowing-yellow-light-bulb-vector-18016094.jpg">
	</p>
    <script type="text/javascript">
    	function led_off()
    	{
           if(document.getElementById("led-off"))
           {
           	digitalWrite(0,'LOW');
           }
    	}
    	function led_on()
    	{
    		if(document.getElementById("led-on"))
    		{
    			digitalWrite(0,'HIGH');
    		}
    	}
    </script>
</body>
</html>

Hi @me23btech11058

Please try removing the setKey('{{ApiKey}}','{{Name}}'); line . This should resolve the “named entity expected none” issue.

If you still face issues, please feel free to get back to us.