Conditional comments are only supported in Internet Explorer and should be avoided for portability.

Use feature detection (as offered by major frameworks such as jQuery) instead.

The following code snippet uses conditional comments to detect whether it is running on Internet Explorer 9 or newer. A better alternative would be to directly check for the desired features using, for instance, jQuery's $.support object.

Note that conditional comments are no longer supported in Internet Explorer 11 Standards mode.

  • Internet Explorer Dev Center: @cc_on Statement (JavaScript).