javascript funtion html code example
Example 1: js function
function name(parameter1, parameter2, parameter3) {
// what the function does
}
Example 2: the function tag in js
<html>
<head>
</head>
<body>
<p id = demo> </p>
<script>
function myEquation(p1, p2, p3, p4) {
return p1 * p2 * p3 * p4
}
document.getElementById("demo").innerHTML = myEquation(8, 7, 1, 9);
</script>
<p> 504 is the answer of my function that made the script say 8x7x1x9.
</body>
</html>