JavaScript


////////JavaScript Data Types////////////
let NAME = 'ASWIN';            ///String  
console.log(NAME);             ///String
//////////////////////////////////////////
let NUMBER = 18;               ///Number
console.log(NUMBER);           ///Number
//////////////////////////////////////////
let AS = {FIRST:'ASWIN', LAST:'B'}//Object
console.log(AS);              ///Object
//////////////////////////////////////////
let NOVALUE = null;           ///null
 console.log (NOVALUE);       //null      
 ////////////////////////////////////////
 let Boolean =false;         ///Boolean
console.log(Boolean);       ///Boolean
/////////////////////////////////////////
let C =['aswin','appu','hello']; ///Array
console.log(C);                  //Array
///////////////////////////////////////////



strings common methods
------------------------------
////length////
let a = 'aswin';
console.log(a.length);
////////////////////
console.log(a.toUpperCase(a));
////////////////////////////
console.log(a.toLowerCase(a));
//////////////////////////////
console.log(a.replace('as','af'));
////////////////////////////////
console.log(a.slice(2,3));
-------------------------------------
loops

//while loop
var num = 0;
while(num < 10){
    num +=1;
       console.log(num);
}


//for loop

 for (let num = 0; num < 100; num++) {
   
   console.log(num);
 }

how to we add 2 numbers together in fuction javascript
------------------------------------------------------

 function num(n1,n2){

     var result = n1+n1;
     console.log(result);

   
}
num(10,10);


loop for while

 


//while loop
var num = 0;
while(num < 10){
    num +=1;
       console.log(num);
}


//for loop

 for (let num = 0; num < 100; num++) {
   
   console.log(num);
 }

how to we add 2 numbers together in fuction javascript

 function num(n1,n2){

     var result = n1+n1;
     console.log(result);

   
}
num(10,10);

javascript prompt

 1.  <!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   style="color: blue; background-color: black;" id="s">HELLO</h1>
 
       
   <script src="index.js"></script>
</body>
</
html>


1.javascript
function fun(){
  var name =  prompt('what is your name');
  var result = 'hello ' + '' + name;
  console.log(result);
  document.getElementById('s').innerHTML = result;
}
fun();



Responsive Navigation Menu Bar using HTML CSS & JavaScript

Step 1

. create index.html
.next create index.css

Step 2
Create index.html
.<!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">
    <link rel="stylesheet" href="index.css">
    <title>Responsive nave bar</title>
</head>
<body>
    <!------nav tags-->
    <nav>
        <label class="logo">Aswinkl71</label>
        <!----ul tags-->
        <ul>
            <li><a href="#">Home</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Contact</a></li>
        </ul>
        <!----ul tags-->
    </nav>
    <!------nav tags-->
</body>
</html>



.next step create index.css
*{ padding:0;
     margin:0:
     text-decoration:none;
     list-style:none:}

.next step
body {
  font-family:monsterrat:
}
nav{ width:100%;
          height:80px;
         background:#34495e;
}
.next step
.logo{
  font-size: 35px;
  font-weight: bold;
  color: white;
  padding: 0 100px;
  line-height: 80px;
}

.next step home, about, contact right side

nav ul{
  float: right;
  margin-right:40px
}

.next step home, about , contact same line
nav li {
  display: inline-block;
margin: 0 8px;
  line-height: 80px;
}
. next step

nav a{
  color: white;
  font-size: 18px;
  text-transform: uppercase;
  border: 1px solid transparent;
  padding: 7px 10px;
  border-radius: 3px;

}

.next step
Go to your index.html file <li><a class="active" href="#">Home</a></li>
add a class name on li,a tags"active" iam create class name

.Next on css file

a.active,a:hover{
  border: 1px solid white;
  transition: .5s;
}



Aswinkl71

Navbar

  < nav class = "navbar navbar-expand-lg navbar-dark bg-dark fixed-top" >   < div class = "container" >   ...