addtrain Posted August 11, 2007 Share Posted August 11, 2007 i am just completely stuck on something with my website. i have this script, where i have the code checks to see if someone has clicked on the image. but to do what i want to do on my website i need to have 2 onclick()s in the same peice of code. here is what the code looks like: <img id="myImage" src="myimage.jpg" onclick="changeSrc()" onclick='img1=true;check();' /> as you can see, i have 2 onclicks, changeSrc() and img1=true;check(); <img id="myImage" src="myimage.jpg" onclick="changeSrc()" onclick='img1=true;check();' /> is this possible, to have 2 onclicks in one peice of script? if not, how do i combine them? is it a problem with image id? PLEASE HELP! Quote Link to comment Share on other sites More sharing options...
php_tom Posted August 11, 2007 Share Posted August 11, 2007 Maybe I don't understand the question... but can't you just do: <img id="myImage" src="myimage.jpg" onclick='changeSrc();img1=true;check();' /> Quote Link to comment Share on other sites More sharing options...
addtrain Posted August 11, 2007 Author Share Posted August 11, 2007 haha, thanks a lot, this really helped! i didnt know that you could do that.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.