I'm trying to use Javascript's built-in replace() method, but for some reason it won't allow me to wrap html around a word and output it to a textarea.
$(function() {
$('#js-convert-markup').click(function() {
var htmlToConvert = $('.markup_converter').val();
htmlToConvert.replace('class', '<span class="admin_styles_type">class</span>');
var convertedMarkup = $('.markup_converted').val(htmlToConvert);
});
});
http://jsfiddle.net/someprimetime/fmu5m/11/
Any idea why?