View Full Version : Execute a script when a user clicks the button
12-29-2010, 12:27 AM
I want to execute a script when the user clicks the button.
Currently in my html doc. i have the button declared.
<input type="button" id ="button" onclick='notEmpty() value="Play"/>
When the button is clicked, i execute the notEmpty() function and I want to execute a script inside the notEmpty(). How can i do this?
12-29-2010, 12:38 AM
Ummm...notEmpty *IS* a script.
I should note that you are missing an apostrophe there: You do onclick='notEmpty() and that's not legal. You *MUST* have the matching apostrophe: onclick='notEmpty()' though it would be better to use quote marks: onclick="notEmpty()"
Where is your code for notEmpty? What does it do? What do you want it to do?
12-29-2010, 12:46 AM
yes. u are right. i missed an apostrophe on my last post.
I want to implement the code below in my notEmpty() function. I want to implement the "src" inside the function.
12-29-2010, 02:08 AM
Ahhh...now I see what you mean. I'll have to let somebody else answer. I know there are ways to invoke stuff like that dynamically, but it's not obvious how.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.