Conditional statements do not work in IE 10 or 11
Support for conditional comments has been removed in Internet Explorer 10 standards and modes to improve HTML5 compatibility and compliance. This means that conditional comments are now treated as regular comments, as in other browsers. This change may affect pages written exclusively for Windows Internet Explorer or on pages that use browser bypass to change their behavior in Internet Explorer.
If you really need to run the code only in these browsers, and you probably shouldn't, you can use JavaScript to define the function as an alternative.
source share