I used textarea tag instead this div[contentEditable="true] before, but it have an issue with text resizing on user typing; and this is the code, that worked in textarea version:
Template.mainFrame.events({
'click button': function(e, t) {
var inputted = t.find('#textarea').value;
Session.set('input', inputted);
t.find('#textarea').value = '';
}
});
Template.mainFrame.someValue = function(){
return Session.get('input');
};
html:
<section>
<div class="input">
<div contentEditable="true" placeholder="type here" id="textarea">
Lorem ipsum sit dolor
</div>
<button>
click me
</button>
</div>
<div class="output">
{{#markdown}}
{{someValue}}
{{/markdown}}
</div>
</section>
But now it is not working; I guess .value method only could be applicable to textarea or inputs and this kind of stuff;
So, the question is: which method in meteor do I use to select content inside div?