Quote:
Originally Posted by TheRobatron Let me know if I haven't understood you, but to call two functions for one event, you will have to create a new function that calls both functions from within it. |
Nope, he can call multiple functions with the same handler:
Code:
onClick="funcA(); funcB();"
Here is a test case:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>JavaScript test</title>
<script type="text/javascript">
function funcA() {
alert("Function A has been called!");
}
function funcB() {
alert("Function B has been called!");
}
</script>
</head>
<body>
<p>Here is a <a href="#" onclick="funcA(); funcB();">link</a>
you can click</p>
</body>
</html>
And the functions will be called in the order specified in the specification of the onClick event handler.
Peace...