Muhammad Shahzad Muhammad Shahzad - 1 year ago 177
jQuery Question

Element find and remove from string/variable using JQuery

I am storing some HTML in a variable. Now I want to remove some div tags from this variable:

editor_data
:

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


The alert shows:


[object Object]


I want to remove this div

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

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download