Jump to content

residentof254

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by residentof254

  1. <p><strong>My first Javascript</strong></p>
    
    <button type="button" on-click="myfunction()">Click here</button>
    <script> function myfunction() {document.getElementById("demo").innerHTML = "Hello its Wednesday";}</script>
    
    <p id="demo">Hello its Tuesday</p> 

    Any assistance would be much appreciated. I am learning the W3Schools tutorials and I can't seem to move forward. The results dont's show its a "Wednesday"!

    <script>
    			function 	light(sw) 	{var pic;
    									if (sw == 0) {pic = "gifs/pic_bulboff.gif"} 
    									else {pic = "gifs/pic_bulbon.gif"}
    						document.getElementById('myImage').src = pic;</script>
    
    			<img id="myImage" src="gifs/pic_bulboff.gif" width="100" height="180">
    
    			<p>	<button type="button" onclick="light(1)">Light On</button>
    				<button type="button" onclick="light(0)">Light Off</button></p>
    

    I can't quite make the light bulb to go on. :sorry:

×
×
  • Create New...