₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,326,543 members, 8,427,029 topics. Date: Monday, 15 June 2026 at 10:04 AM

Toggle theme

Script - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingScript (871 Views)

1 Reply

Script by legendmic(op): 5:11pm On Dec 27, 2013
<!DOCTYPE html>
<html>
<body>
<script>
function changeImage()
{
element=document.getElementById('myimage')
if (element.src.match("bulbon"wink)
{
element.src="pic_bulboff.gif";
}
else
{
element.src="pic_bulbon.gif";
}
}
</script>

<img id="myimage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">

<p>Click the light bulb to turn on/off the light</p>

</body>
</html>
Re: Script by legendmic(op): 5:15pm On Dec 27, 2013

<!DOCTYPE html>
<html>
<body>
<script>
function changeImage()
{
element=document.getElementById('myimage')
if (element.src.match("bulbon"wink)
{
element.src="pic_bulboff.gif";
}
else
{
element.src="pic_bulbon.gif";
}
}
</script>

<img id="myimage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">

<p>Click the light bulb to turn on/off the light</p>

</body>
</html>

1 Reply

234

134 Sites For FreelancersC++ Tutorial Download LinkConsultant Web Programmer Needed