This is my js code:
$("tr[id^=list2ghead_]").each(function(){
j = i+1;
id_name = $(this).attr("id");
id_name_lenght = id_name.length;
if (i >= 10){
id_name = id_name.substr(0, id_name_lenght-2);
}else{
id_name = id_name.substr(0, id_name_lenght-1);
}
html = $("#"+id_name+i).nextUntil("#"+id_name+j).outerHTML;
$("#"+id_name+i).nextUntil("#"+id_name+j).remove();
html = "<div class='content'>"+html+"</div>";
$(html).insertAfter("#"+id_name+i);
i++;
});
I want to get the HTML content between two IDs. After that I want to add to this HTML to a div
with a class "content", remove the exiting HTML, and insert after an ID the HTML the new div
. Now outerHtml
returns undefined
. What should I do ?
This is htnml code generated by jQgrid plugin: