I am using CKEditor. I have the html in a textarea. I want to get that HTML. And want to apply a class on the body tag in that markup.
jQuery('#htmlData').val()
gives me the HTML.
How can I apply a class in the body tag present in th开发者_Go百科is val()
? Do I need to use html()
?
I need the selector for this.
jQuery(jQuery('#htmlData').val()).css('color','red');
Do you have a live example/demo?
This might work:
jQuery("body", jQuery('#htmlData').val()).addClass("something");
精彩评论