1.

Round a number to specified decimal place in JavaScript

Answer»

Use the document.forms length property of forms to count the number of forms in a document. Here’s an example for the same: 

<!DOCTYPE HTML&GT; <html> <body> <form> NAME: <input type="text" name="my_name" value="DEMO"> Password: <input type="password" name="pwd" value=""> <input type="submit" value="Submit"> </form> <script>   var res = document.forms.length;   document.write("<br>Count of forms = "+res); </script> </body> </html>

The output displays the count: 



Discussion

No Comment Found