I hate jQuery, and I also am quite a noob at it (although I am great at normal JS). Every now and then, I encounter a good snippet that happens to use jQuery in it... Can someone here help me to convert it into pure JS to use?
My most recent issue:
var txt = $('#comments'),
hiddenDiv = $(document.createElement('div')),
content = null;
hiddenDiv.addClass('hiddendiv common');
$('body').append(hiddenDiv);
txt.on('keyup', function () {
content = $(this).val();
content = content.replace(/\n/g, '<br>');
hiddenDiv.html(content + '<br class="lbr">');
$(this).css('height', hiddenDiv.height());
});
Thanks in advance!