Display 1 to 10 in JavaScript
<html> <body> <script> for (var i = 1; i <= 10; i++) { document.write(i + "<br>"); } </script> </body> </html>
Display 1 to 10 in JavaScript Read More<html> <body> <script> for (var i = 1; i <= 10; i++) { document.write(i + "<br>"); } </script> </body> </html>
Display 1 to 10 in JavaScript Read More<html> <head> <script> function calculate() { var base = document.getElementById("base").value; var exponent = document.getElementById("exponent").value; var result = Math.pow(base, exponent); document.getElementById("output").innerHTML = "The result is " + result; } </script> </head> …
finding power in JavaScript Read More<html> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.min.js"> </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.min.js"> </script> <script> $(document).ready (function () { $("#basic-form").validate (); }); </script> <body> <h4> jQuery Validation Form Example </h4> <form id = "basic-form" action="" method="post"> <p> …
JQuery form validation in JavaScript Read More<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("#hide").click(function(){ $("p").hide(); }); $("#show").click(function(){ $("p").show(); }); }); </script> </head> <body> <p> HELLO WORLD THIS </p> <button id="hide">Hide</button> <button id="show">Show</button> </body> </html>
JQuery simple example in JavaScript Read More<html> <head> <title>Form Validation</title> <script> function validate() { var b=document.frm1.txtEmail.value; var len=b.length; var a='@'; var dot='.'; var valid1,valid2; //form validation for First Name if(document.frm1.txtFirstName.value=="") { alert("The First Name is Empty"); …
form validation using JavaScript Read More<script> function validate() { var msg; if(document.form.strength.value.length>8) { msg="Strong"; } else if(document.form.strength.value.length>3) { msg="Good"; } else { msg="Poor"; } document.getElementById('pw').innerHTML=msg; } </script> <h1>CHECK STRENGTH OF PASSWORD</h1> <form name="form"> <input type="password" …
check password strength using JavaScript Read More<!DOCTYPE html> <html> <head> <script> function matchpass() { var firstpassword=document.f1.password.value; var secondpassword=document.f1.password2.value; if(firstpassword==secondpassword){ return true; } else{ alert("password must be same!"); return false; } } </script> </head> <body> <form name="f1" …
Validate Password in JavaScript Read More<html> <head> <script> function palin() { var n,r,sum=0,temp; n=Number(document.getElementById(“no_input”).value); temp=n; while(n>0) { r=n%10; sum=sum*10+r; n=parseInt(n/10); } if(sum==temp) { alert("Palindrome Number"; } else { alert("Not Palindrome Number"); } } </script> </head> …
Palindrome or Not using JavaScript Read More<html> <head> <script> function setCase (caseType) { var firstNameString; var lastNameString; firstNameString = document.myForm.firstName.value; lastNameString = document.myForm.lastName.value; if (caseType == "upper ") { document.myForm.firstName.value = firstNameString.toUpperCase(); document.myForm.lastName.value = lastNameString.toUpperCase(); } …
Change case using JavaScript Read More<html> <body> <h2>Switch case, generates system date </h2> <p id="demo"></p> <script> let day; switch (new Date().getDay()) { case 0: day = "Sunday"; break; case 1: day = "Monday"; break; case …
Switch Case example in JavaScript Read More