HEADER ADS 728X90

IF / ELSE - CONDITIONAL STATEMENT || Javascript TUTORIAL || BY Ascode

tutorial,javascript,javascript tutorial,javascript tutorials,if else,if else javascript,if else statement in javascript,else if,javascript tutorials for beginners,javascript if else,javascript (programming language),javascript tutorial for beginners,tutorials,else,introduction to javascript,javascript if,javascript lesson,javascript if statement,if else in javascript,if else statement,else if javascript,javascript else if,if else in java,javascript tutorial,javascript tutorial for beginners,javascript,javascript tutorials,javascript for beginners,learn javascript,tutorial,programming tutorial javascript,java script tutorial,tutorial javascript,javascript course,javascript tutorial in hindi,javascript basics,js tutorial,javascript crash course,javascript tutorial beginners,javascript (programming language),javascript beginner tutorial,learn javascript for beginners,ascode, coding tutorial, how to learn coding easy way to learn coding

Hi dear welcome to Ascode Blog . In this post we are going to learn How to use If/Else Contion In Javascript. First Creat A index.html file Copy This HTML CODE and pest it one your code editor. 2ndly creat style.css file Then Copy The CSS CODE . 3ndly creat ap.js file Then Copy The Javascript CODEand pest it then open the index.html file with your browser.

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">
    <title>If Else Uses javascript</title>
</head>
<body>
   
    <div id="number"></div>

</body>
</html>

CSS

*{
        margin: 0;
        padding: 0;
        font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
        box-sizing: border-box;
    }
    body {
        display: flex;
        justify-content: center;
        align-items: center ;
        min-height: 100vh;
    }
    #number {
        font-size: 7rem;
        padding: 30px 50px;
        background: #000;
        color: #fff;
        width: fit-content;
        font-weight: 600;
        border-radius:10px ;
    }

Javascript

let number = document.getElementById('number');
        let Counter = 0;
        setInterval(() => {
            if(Counter == 100){
                clearInterval();
            }
            else{
                Counter += 1;
                number.innerHTML = Counter + '';
            }
        }, 100);

Youtube Tutorial

FLOW US ON SOCIAL MEDIA

Post a Comment

0 Comments

Join Telegram