Hello,
I have a function like this:
I want it to look like this:Code:video.addEventListener("play", function(event) { // show image A });
How would I achieve this?Code:if (play) { show image A } else { show image B }
Thanks
| SitePoint Sponsor |
Hello,
I have a function like this:
I want it to look like this:Code:video.addEventListener("play", function(event) { // show image A });
How would I achieve this?Code:if (play) { show image A } else { show image B }
Thanks


Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript
It's just an example. I want to make an else statement to a function like this one and see if it possible. There should be other ways around but I has yet to discover it.
Sorry, I'm confused at the moment, will ask again later after doing some experiments.

Is there some reason why simply wrapping the if/else inside the function wouldn't work?
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
Bookmarks