answersLogoWhite

0

Java script program using if else?

Updated: 10/23/2022
User Avatar

Wiki User

11y ago

Best Answer

Here we go...

if(document.addListener){

alert("Yay! Not IE!");

}else{

alert("Booo! IE or something terribly old.");

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Java script program using if else?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is it possible to store Java program data?

Yes. Java program data can be stored in RAM, in a file, sent across a network, or however else you (the programmer) wishes it to be stored.


Why is Java making your computer so slow?

It shouldn't - especially when you aren't executing any program that uses Java. There may be something else that is slowing down the computer.


How you redirect the output of the perl script into some file using perl script?

If the perl script outputs to the standard output device, use the I/O redirection operators (>, >>, |) to redirect it somewhere else.


What is Control structures in java?

Control structures in java are nothing but like how u structure your program based on conditions like if-else using switch-case using for loops all together conditions applying things are called control structures


How do you get save dialog box using java script?

Use the confirm dialog box. Below is the code <html> <body> <button onclick="showConfirm()">Save</button> <script> function showConfirm() { var x; var r=confirm("Are you sure you want to save the data?"); if (r==true) { x="You pressed OK!"; // In place of x write code to be executed } else { x="You pressed Cancel!"; // Leave else statement unless necessary } document.getElementById("demo").innerHTML=x; } </script> </body> </html>


Shell script that copies multiple files to a directory?

That's what cp(1) program is good for: cp this that "something else" /dir/to/


Write a shell program using the if-the-else to test whether a variable name is a directory or a file?

# shell script example if [ -f $1 ]; then echo $1 is a file elsif [ -d $1 ]; then echo $1 is a directory fi


How can redirect based on date month java script?

i have tried the following <script type="text/javascript"> var curtime = new Date(), curday = curtime.getDate(), curmonth = curtime.getMonth()+1; if (currentmonth 14) window.location = "homevlntns.html"; if (currentmonth 31) window.location = "homehllwn.html"; if (currentmonth 25) window.location = "homexmas.html"; else window.location = "error.html"; </script> but no luck.


Program for electricity bill using if-else ladder in c?

if (has_enough_money) { pay_the_bill(); }


Where can I get the a little princess script?

On the Internet where else.


Java program to check A is divisible by B?

Implement this method: public static boolean isDivisible(int a, int b) { if(a % b == 0) { return true; } else { return false; } }


Write a program By using if else statement to read a number and check whether it is positive or negative?

write a c++program by using if statement to read a number and check whether it is positive or negative