/    Sign up×
Community /Pin to ProfileBookmark

On (Button) Click run all JavaScripts

Hello All Web Developers!

Could you help me please with the following task ?!

I have some JavaScripts on my HTML page. I would like to place a button on that page, with that (On Click) user could run all JavaScripts on that page!

So, OnClick RUN all JavaScripts!

Thank you very much in Advance!

Regards,
Max

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@cupofjoeMar 17.2005 — i dont know if this is what you're looking for, but if you want you button to run all your functions then you could have the button call a main function which holds the other functions

[code=php]
<input type="button" value="click" onclick="Main();">

<script language="JavaScript">
<!--
function Main()
{
Hello();
GoodBye();
TheEnd();
}
function Hello()
{
alert("Hello");
}
function GoodBye()
{
alert("Good-Bye");
}
function TheEnd()
{
alert("this is the end");
}
//-->
</script>
[/code]


~Joe
Copy linkTweet thisAlerts:
@JPnycMar 17.2005 — It should be mentioned that a browser's javascript engine is not multi-threaded so all the functions may, or may not, execute together.
Copy linkTweet thisAlerts:
@maximo_nazarauthorMar 17.2005 — Hello!

Thank you very much! It works!

Regards,

Max
×

Success!

Help @maximo_nazar spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.13,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...