Microsoft HTA/Version checking

You've reached the final tutorial in the Microsoft HTA tutorial series. This tutorial is about using Internet Explorer conditional comments to check whether a specific version of IE is being used or not. Conditional comments are fairly simple. They start with.

Making expressions
Expressions are used in conditional comments to restrict content to certain versions of Internet Explorer. Let's begin with a simple expression:. This checks if the IE version is equal to 6. Maybe you want to check if a version of Internet Explorer is below or equal/above IE7. In that case, you can have two different conditional comments:  and. The  and   operators are two of the four numerical operators that can be used instead of the default equals operator. There is a table below showing the different numerical operators.

There are also three Boolean operators: And, Or, and Not. Before using the operators, surround the first operand (including their numerical operators) with parentheses and then put the symbol where it needs to go (before for Not and after for And/Or). In the case of two-operand operators (And/Or), place the second operand after their symbol. Make sure that the second operand has parentheses too!

Using conditional comments
Here is an example of the use of conditional comments: