SmokingMan Posted May 21, 2006 Share Posted May 21, 2006 I have buttons used for onmouseover, onmouseout, & onclick events. The onclick event does not work. There is an onclick event in the <a> tag that works, but the one in the <img> tag does not. Since they are in two different tags, I thought it would work. But since the <img> tag is in the <a> tag, would that prevent the onclick event in the <img> tag from working? Here's the link to the page.I can live without the 3rd event, but I don't want to if I don't have to Link to comment Share on other sites More sharing options...
Webworldx Posted May 21, 2006 Share Posted May 21, 2006 document.getElementById(imgName).src = clickedImage(imgName).src;to: document.getElementById(imgName).src = clickedImage[imgName].src;Does that help? Link to comment Share on other sites More sharing options...
scott100 Posted May 22, 2006 Share Posted May 22, 2006 Also, i don't think it is sensible to have your code broken onto 4 lines: <img class="noborder" id="previous" src="../../images/pre-ssbutton1.gif" alt="Previous Image" title="Previous Image" width="100" height="17" onmouseover="imageOn('previous'); return statusMsg('Previous Image')"; onmouseout="imageOff('previous'); return statusMsg('')"; onclick="imageClicked('previous'); return statusMsg('Previous Image')"> From what i can remember an element must be contained within one line (unless the source code reaches the end of the line and needs to force a break) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now