Posts

Showing posts from March, 2023

JavaScript Nested Loop

Image
  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title >Document</ title > </ head > < body onresize = " display ()" >     < h1 >Nested for Loop</ h1 >     < script >         for ( let i = 1 ; i <= 6 ; i ++ ){           for ( let j = 1 ; j <= i; j ++ )          {             document . write ( "*" )          }          document . write ( "<br>" )        }     </ script > </ body > </ html >

Javascript Window and Keyboard Event

  Want to understand Properly Plz see the video carefully on YouTube channel name is Adisma <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title >Document</ title > </ head > < body onresize = " display ()" >     < h1 >Javascript Keyboard & Window Event</ h1 >     <!-- <button onkeyup = "display()">Keyboard : Event : Click ME</button> -->     < script >         function display (){             alert ( "Hi, Event was triggered" )         }     </ script > </ body > </ html > The KeyboardEvent Object handles events that occur ...

Javascript Mouse Event

  Want to understand Properly Plz see the video carefully on YouTube channel name is Adisma Try It (Example) <! DOCTYPE html > < html > < body > < script > function sayHello ( ) { alert ( "Onclick event." ) } </ script > < p > Click Say Hello button and see result. </ p > < form > < input type = "button" onclick = "sayHello()" value = "Say Hello" /> </ form > </ body > </ html > Mouse Events Event Occurs When onclick A user clicks on an element oncontextmenu A user right-clicks on an element ondblclick A user double-clicks on an element onmousedown A mouse button is pressed over an element onmouseenter The mouse pointer moves into an element onmouseleave The mouse pointer moves out of an element onmousemove The mouse pointer moves over an element onmouseout The mouse pointer moves out of an element onmouseover The mouse pointer moves onto a...

JavaScript Global and Local Variable

Want to understand Properly Plz see the video carefully on YouTube channel name is Adisma   <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title >Document</ title > </ head > < body >     < script >         var a = 10 ;         function display (){               var a = 20 ;             document . write ( "ADISMA <br>" );                       document . write (a + "<br>" );           }         var a = 30 ;         display ();   ...

JavaScript Function with return Value

  JavaScript Function with return Value <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title >Document</ title > </ head > < body >     < h1 >JavaScript Function with return Value</ h1 >     < script >         function   userdetails ( fname , lname ){             // console.log("Hello " + fname + " " + lname);             return "Hello " + fname + " " + lname         }         let a = userdetails ( "Seema" , "Sharma" ); // actual Value        document . write (a);     </ script > </ bod...

JavaScript Function With Parameter

  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title >Document</ title > </ head > < body >     < script >         // function sum() {         //     let a = 40;         //     let b = 60;         //     let c= a+b;         //     console.log(c);         // }         // sum();           function sum ( a , b ) {   // Function Parameters             let c = a + b ;             console . log (c);     ...

JavaScript Function

  A JavaScript function is a block of code designed to perform a particular task. A JavaScript function is executed when "something" invokes it (calls it). <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title >Document</ title > </ head > < body >     < script >         // document.write("Seema Sharma <br>");         // document.write("Channel Name Adisma <br>");         // document.write("Namaste India <br>")         // document.write("<hr>")         function display () {             document . write ( "Seema Sharma <br>" ...

JavaScript Table of Any Number

  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title >Document</ title > </ head > < body >     < script >               let limit = prompt ( "Enter Your Limit to print Even Number" );     for ( let i = 1 ; i <= limit ; i ++ ){             if (i % 2 == 0 ){                 document . write (i + "<br>" );             }     }             </ script > </ body > </ html >

JavaScript Prompt Box

Prompt Box A prompt box is often used if you want the user to input a value before entering a page. When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed after entering an input value. If the user clicks "OK" the box returns the input value. If the user clicks "Cancel" the box returns null. <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title >Document</ title > </ head > < body >     < script >             let a = prompt ( "Enter Your First Name" );               let b = prompt ( "Enter Your last Name" )              document . write (a + " " + ...

JavaScript Confirm Box

  JavaScript has three kind of popup boxes: Alert box, Confirm box, and Prompt box. Confirm box <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title >Document</ title > </ head > < body >     < script >                 //ok = true         //cancel = false     var valueOfConfirm = confirm ( "Namaste India" );     // alert(valueOfConfirm)     if (valueOfConfirm){           alert ( "Hi.. Iam Good" )     } else {         alert ( "Bye byee" )     }             </ script > </ body > </ ht...

Javascript Alert() : Popup Box

  JavaScript has three kind of popup boxes: Alert box, Confirm box, and Prompt box. Alert Box An alert box is often used if you want to make sure information comes through to the user. When an alert box pops up, the user will have to click "OK" to proceed. alert( "Hello Adisma" ); -------------------------------------------- <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title >Document</ title > </ head > < body >     < button   onclick = " showAlert ()" >Alert</ button >     < script >                 // alert("Hello Every One");         //let num = 15;         // alert("Nu...