Ok this might sound basic, but i'm trying to learn javascript. I set myself a challenge to make a function which returns the product of two numbers, i have managed to write the function as follows
What i would like to know is, how do i call the function with two values that have been entered into text boxes on the html page, instead of the hard coded 5 and 9?
Code:
<html>
<head>
<script type="text/javascript">
function product(x,y)
{
return x*y
}
</script>
<script type="text/javascript">
document.write(product(5,9))
</script>
</head>
<body>
</body>
</html>
What i would like to know is, how do i call the function with two values that have been entered into text boxes on the html page, instead of the hard coded 5 and 9?