Program of the length of a number in Javascript JS with the flowchart
Program of the length of a number in Javascript JS with the flowchart
In this tutorial, we will try to learn the followings;
- Flowchart of the Length of a number program.
- Javascript program to show the Length of a number.
- javascript program to show the Length of a number of form values entered by the user.
Flowchart of the Length of a number program
Javascript program to show the Length of a number
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <!DOCTYPE html> <html> <head> <script> function f2(){ var x; var len; x=document.getElementById("num").value; len=x.length; document.getElementById("this").innerHTML =len; } </script> </head> <body> <p>Entered Number:</p> <input id="num" value="123"> <p>Click the button to print thr number of digits.</p> <button onclick="f2()">Click</button><p></p> <p id="this">Answer</p> </body> </html> |
javascript program to show the Length of a number of form values entered by the user.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <!DOCTYPE html> <html> <head> <script> function func(){ var x; var len; x=document.getElementById("num").value; len=x.length; document.getElementById("this").innerHTML =len; } </script> </head> <body> <p>Enter the Number:</p> <input id="num"> <p>Click the button to print thr number of digits.</p> <button onclick="func()">Click</button><p></p> <p id="this">Answer</p> </body> </html> |
Topic Covered
javascript program to show the reverse of numbers.
List of All Programs of Javascript : Click Here .