View Full Version : How do I trigger two JS functions from HTML?
Zapcat
09-26-2002, 10:23 AM
You'd think this sort of question would be covered in tutorials in books or WWW sites, but it isn't!!
Can anyone tell me how to trigger two js functions from one HTML line (a drop down list in this particular case)?
Thanks!
ZapCat :)
mpjbrennan
09-26-2002, 10:54 AM
Here's a simple example:
patrick
-----------------------
<html>
<head>
<script type="text/javascript">
function change1(){
document.getElementById('text1').innerHTML = "I've"
}
function change2(){
document.getElementById('text2').innerHTML = "changed!"
}
</script>
</head>
<body>
<p id="text1">Hi</p>
<p id="text2">there!</p>
<button onclick="change1(); change2()">change text</button>
</body>
</html>
glenngv
09-26-2002, 10:55 AM
is this what you want?
<select onchange="function1();function2()">
Zapcat
09-26-2002, 12:06 PM
Thanks!!:thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.