An item finds and removes from a string / variable using jQuery

I save some HTML in a variable. Now I want to remove the div tags from this variable: editor_data :

 function validate_step_3() { var editor_data = CKEDITOR.instances.editor1.getData(); var i = $(editor_data); alert(i); } 

A warning will appear:

[object of object]

I want to delete this div

 editor_data.find('#fetch_InCkeditor').remove(); 
+7
source share
2 answers

$(editor_data).find('#fetch_InCkeditor').remove(); . :)

+11
source

The id on the page must be unique .

So, in this case it should be enough $('#fetch_InCkeditor').remove();

0
source

All Articles