0
This HTML program is not satisfying the if else statement , Why ?
<!DOCTYPE html> <html> <head> Javascript </head> <body><script> var myNum1 = 7; var myNum2 = 8; if (myNum1 = myNum2) { alert("This is my first condition"); } else { alert("This is my second condition"); } </script> </body> </html>
1 Answer
+ 14
Use == to check condition.
if (myNum1 == myNum2){
//
}