Reputation: 359
How do I get the html content of a template? For example, I have the following template:
<template name="test">
<div id="example">
<strong>This is a test.</strong>
</div> <button id="btn">Get</button></template>
I need the event click of button the HTML contents of the div # example is captured. it possible?
Upvotes: 1
Views: 577
Reputation:
As of Meteor 1.x, you can use Blaze.toHTML(). It returns the HTML of the given Template as a String.
Upvotes: 1
Reputation: 1708
If you assign the click event using Template.test.events you should have all the data that template describess in your "this".
Upvotes: 0