Passing a template in innerHTML javascript method

I want to pass a template {{> exampleTemplate }} into innerHtml javascript method like this
selector.innerHtml("{{> exampleTemplate}}"); but it always parsed as a string, Am I doing it wrong or Is there another way to do it ?

You can get the exact behaviour you’re looking for using Blaze.render

var element = document.querySelector('.my-selector');
Blaze.render('exampleTemplate', element);

But doing this is a warning sign that you’re using the wrong approach, as you should be able to dynamically render the things you want using ordinary Blaze templates

What exactly are you trying to do here?

1 Like

Thanks buddy, This is just what i wanted