Define a function to accept the string value : Function « Language Basics « JavaScript DHTML
- JavaScript DHTML
- Language Basics
- Function
Define a function to accept the string value
<html>
<head>
<title>My First Page</title>
<script type = "text/javascript">
function myFunc(textToAlert) {
alert(textToAlert);
}
myFunc("This is a test");
</script>
</head>
<body>
</body>
</html>
Related examples in the same category