I try convert simple string to HTML object
for process it with jQuery
.
My code:
var old_code_text = $(invoice_template_id).html();
console.log("old text ="+old_code_text);
old_code_text=$(old_code_text);
console.log("old text2 ="+old_code_text.html());
My first alert show me:
old text =<div id="template_invoice">
<div id="first_head">
<div id="logo_invoice">
<img src="../../../images/invoice_logos/logo912131214.PNG" width="200px">
</div>
<div id="main_header_info">
....
....
</div>
</div>
But my second alert show me :
old text2 =
<div id="first_head">
<div id="logo_invoice">
<img src="../../../images/invoice_logos/logo912131214.PNG" width="200px">
</div>
<div id="main_header_info">
....
Then I use old_code_text
like it:
old_code_text.find("#product_invoice_table tbody").empty();
I dont understand where is div with id template_invoice? When I parse string this div always deleted.
Thanks.