<form name="f1" method="GET">
<form name="f1">
<input type="text" name="rd" id="rd">
<input type="text" name="fala" id="rd">
<button onclick="cal()"></button>
</form>
How to use a nested function in javascript to print some output in HTML.
function abc() {
var radius = document.f1.rd.value;
document.write(radius)
}
function def() {
var fala = document.f1.fala.value;
document.write(fala)
}
function cal() {
def()
abc()
}
The nested functions should be called by single function and then will be used in button on click event
call()doesn't have nested functions. It is just calling the functionsdef()andabc(). Are you asking how to getcall()to execute onClick?