I would like to call a function within a function. Is this even possible??
When I do this I get "undefined"
Here's my code:
I know you can just return in the first function, "product()" but I would like to do something else in my second function "display()" then return a value.
thanks
When I do this I get "undefined"
Here's my code:
Code:
<html>
<head>
<script type="text/javascript">
function product(a,b){
total = a*b;
display(total);
}
function display(num){
return num;
}
</script>
</head>
<body>
<h1>This text I do NOT want to be erased.</h1>
<a href="[URL unfurl="true"]http://google.com"[/URL] target="_blank">Total: </a>
<script type="text/javascript">
product(3,4);
document.write(display());
</script>
</body>
</html>
I know you can just return in the first function, "product()" but I would like to do something else in my second function "display()" then return a value.
thanks