HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <p>Click on the following button to count the number of forms.</p> <button onclick="myFunction()">Click Me</button> <p id="point"></p> <form> Name: <input type="text"> </form> <form> Age: <input type="text"> </form> <script> var x = document.getElementById("point"); function myFunction(){ x.innerHTML = document.forms.length; } </script> </body> </html>
OUTPUT
×

Save as Private