How do I alter <html> using Blaze?

E.g. the template I’m using wants to do the following:

<!DOCTYPE html>
<!--[if IE 8]>         <html class="ie8"> <![endif]-->
<!--[if IE 9]>         <html class="ie9 gt-ie8"> <![endif]-->
<!--[if gt IE 9]><!--> <html class="gt-ie8 gt-ie9 not-ie"> <!--<![endif]-->
<head>

I don’t understand where I’m supposed to put that code for client side rendering?

You can’t modify the doctype or HTML element before Meteor composes your page and sends it to the client. What you can do is add classnames after the page has rendered (ie. if your css depends on it). Eg.:

Template.body.onRendered(function() {
  $("html").addClass("ie8");
});
1 Like