if statements

P

Prophet

I am new to webdesign and am looking for the correct way to do a "if"
statement.

Eg. if a>b then X, else Y

I can do this in excel, but have never done this in a web page - I know this
is so basic but it escapes me on how to do it.

Thanks,
 
M

McKirahan

Prophet said:
I am new to webdesign and am looking for the correct way to do a "if"
statement.

Eg. if a>b then X, else Y

I can do this in excel, but have never done this in a web page - I know this
is so basic but it escapes me on how to do it.

Thanks,

Will this help?

<html>
<head>
<title>test1234.htm</title>
<script type="text/javascript">
if (1 == 2) {
alert("1 = 2");
} else {
alert("1 != 2");
}
(3 == 4) ? alert("3 = 4") : alert("3 != 4");
</script>
</head>
<body>
</body>
</html>
 
L

Lee

Prophet said:
I am new to webdesign and am looking for the correct way to do a "if"
statement.

Eg. if a>b then X, else Y

I can do this in excel, but have never done this in a web page - I know this
is so basic but it escapes me on how to do it.

The correct way to do it is to find a manual or on-line tutorial.
You don't guess, and you don't ask for help with something that basic.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top