![]() |
problem with accessing onclick attribute
What I am trying to achieve, is a button that calls a function that changes the onclick attribute of that button, so that when it is clicked again, it resets the onclick attribute to call the default function. here is what the stripped down code looks like:
Code:
<html>thanks for the help this part of my code is killing me. |
you want it to be able to flip back and forth infinitely?
Code:
<html> |
yes, this is great, thank you!
|
:thumbsup: you're welcome. there's actually lots of ways to do this. here's another which is a bit closer to what you were trying:
Code:
<html> |
thank you, seriously I've been puzzled over why it didn't work for the past two days, now I can focus on other things, like sleep
|
just remember that the HTML event attributes are not the same as the JavaScript event properties. the former require a parseable JavaScript expression/statement, while the latter require a function. there are also differences in the used scope and automatically passed parameters.
PHP Code:
PHP Code:
|
| All times are GMT +1. The time now is 10:06 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.