var text = document.createTextNode('<p>MyText</p>');document.body.appendChild(text);
<p>MyText</p>
$("#answer1").click(function(){ $('ul li').append('✓');});
$(function() { $('#answer2').click(function() { var content = '<a href="#">✓ TADAAA!</a>'; $('textarea').append( content .replace(/\&/g, '&') .replace(/</g, '<') .replace(/>/g, '>') ); });});
$('#answer2').live('click', function(){});
$('#answer2').click(function(){});
I am trying to make a link which once clicked will add text to the text area/field. The text needs to be pure text (HTML not translated).
So I got two pieces of jquery code which I struggling to make work together to achieve what I want.
To make HTML be plain text I have this code:
And to append the to the text area I have a rough idea, like this:
(found on internet)
Now can anyone help me structure this code to function the way I want, please?
Regards
Aleksander
http://jsfiddle.net/tovic/kMmVU/3/
instead of this: