471,598 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,598 software developers and data experts.

How do you execute an 'if' statement with html

How do you execute an if-statement on a drop down box. I have to do a camera website and basically there's a drop down box for camera manufacturer, if an option is clicked then reaults are displayed thats what i'm going for
Nov 8 '07 #1
2 3208
6,050 Expert 4TB
Impossible to do through HTML or CSS

Head over to the Javascript/AJAX forum.

Or, indeed, the PHP forum

Nov 8 '07 #2
111 100+
The if statements in html are really basic.

I've only ever used them to detect the browser and browser version. not sure if they can be used to do anything else, as i've never tried to do anything else with them.

IF statements need to be inside HTML comments, i.e.

[HTML]<!-- -->[/HTML]

Interent Explorer is the only browser that will run these IF statements as it is the only broswer that executes HTML comments. All the other browsers ignore HTML comments.

You can use the if statements to include other stylesheets or javascript files. based on whether the browser is internet explorer and the version


[HTML]<!--[if lt IE 7]>
<link rel="stylesheet" href="css/styles-lessthan7.css" type="text/css" />

<!--[if IE]>
<link rel="stylesheet" href="css/styles-ie.css" type="text/css" />
Nov 8 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Sheila King | last post: by
3 posts views Thread by robert | last post: by
1 post views Thread by PJ | last post: by
4 posts views Thread by Sergey Suleymanov | last post: by
7 posts views Thread by JIM.H. | last post: by
1 post views Thread by Brendan Jurd | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.