Calling a Function from an Event Handler : General Event « Event « JavaScript DHTML
- JavaScript DHTML
- Event
- General Event
Calling a Function from an Event Handler
<html>
<head>
<script type="text/javascript">
function showMsg(msg) {
document.write("The button sent: " + msg);
}
</script>
</head>
<body>
<form>
<input type="button" value="Click Me"
onclick="showMsg('The button has been clicked!')">
</form>
</body>
</html>
Related examples in the same category