Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <title>Length Calculator</title>
- <body>
- <label><a href ="Missions Diary.html">Mission Diary</a></label>
- <script type="text/javascript">
- function reload() {
- location.reload();
- }
- function le() {
- var x = prompt("Type here the string *the length will include spaces too.", "")
- var y = prompt("Type here the number of chars *including spaces* that you want that's the length won't include.", "Type letters as the number of chars that you want to delete. Example: i want to delete 3 letters so: aaa")
- var z = x.length - y.length
- if(confirm("The length of ths string is: " + z)) {
- reload();
- }
- }
- </script>
- <p><b>To find the length of the string</b></p>
- <form>
- <input type="button" value="Click here" onClick="le()">
- </form>
- <p><b>To refresh the page</b></p>
- <form>
- <input type="button" value="Click here" onClick="reload()">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement