Home of web learners

www.webn3rd.com

javascript has if else to use condtion

Let do a javascript program

<html>
<head>
    
</head>
<body>
    <script>
    var a=2;
    if(a==2){
        document.write("Its two");
    }
</script>       
</body>
</html>

Here,we assign a variable 2,and check data of this variable and we got the if conditon true,so the output come

webn3rd.com

About webn3rd