Home
<!DOCTYPE html> <html> <body> <h1>Demo: if-else condition</h1> <script> var mySal = 500; var yourSal = 1000; if( mySal > yourSal) { alert("My Salary is greater than your salary"); } else if(mySal < yourSal) { alert("My Salary is less than your salary"); } </script> </body> </html>
Result: