I'm trying to 'append' HTML elements into a textarea. I figured out how to insert the HTML elements:
see here -------> jsFiddle <--------
But I cannot figure out how to APPEND.
Here's the code anyways:
HTML
<select id='sel' size='1'>
<option><></></option>
<option><p></p></option>
<option><div></p></option>
<option><a></a></option>
</select><br/><br/>
<textarea id='txtarea'></textarea>
jQuery
$(document).ready(function() {
$('select').change(function() {
$('textarea').html($(this).val());
});
});
Does anyone know how to APPEND html element text to the textarea? What I mean is if you keep clicking the "<p></p>" item it will keep inserting itself after the other.
Thanks!!