I'll be using a textarea as a code editor. I want to get the value of the textarea and it as the CSS for a specified element.
HTML
<textarea class-"editor">
background: blue;
border: 1px solid pink;
</textarea>
JS
$('.editor').keyup(function(){
var editor_contents = $('.editor').val();
$('#element').css(editor_contents);
});
As you can see, I don't want to choose a specific CSS property to target. I want to apply the value of the textarea in a string on the style property of #element.