Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Here is part of my html code : </style> <script type = \"text/javascript\"> <!--

ID: 3544681 • Letter: H

Question

Here is part of my html code :


     

     

    </style>

<script type = "text/javascript">

<!--

function showImage(btn)

{

var imgs = document.getElementsByTagName("img");


for( var i =0; i < imgs.length; i++) {


name = imgs[i].getAttribute("name");


if(name == 'images') {

if(imgs[i].id == btn.value)

imgs[i].style.display = 'block';

else

imgs[i].style.display = 'none';

}

}


}

-->

</script>

    

</head>

<body>

    <form id="form1" runat="server">

    <div id="nav">

        <ul id="nav_ul">

            <li><a href="index.html">Index</a></li>

            <li><a href="l5p1.html">l5p1</a></li>

            <li><a href="l5p2.html">l5p2</a></li>

            <li><a href="l5p3.html">l5p3</a></li>

        </ul>

    </div>

    <br /><br />

  <center><div id="img_holder"><img id="image" src="/tools/hoe.jpg"  /></div></center>

  <br /><br />

    <center><div id="buttonpanel">

<input type="button" name="btnImage1" value="Image1" />

<input type="button" name="btnImage2" value="Image2" />

<input type="button" name="btnImage3" value="Image3" />

</div>

</center>

    </form>

</body>

</html>



The only problem is that the buttons are not working, it displays no image (blank). Can someone please help!!!!!!!!!!!!!!!!!!!

Here is part of my html code : The only problem is that the buttons are not working, it displays no image (blank). Can someone please help

Explanation / Answer

Try putting the image path in single quotes. E.g.


"showImage('/tools/hoe.jpg')"


Do it for others too


Please ratr if that helped