javascript - Wrap two divs with td with jQuery -
i have following code in html , it's inside table , in 1 <td>
. fields in sugarcrm ce. first <div>
original system(studio). second 1 span inside created jquery.
my task wrap() them jquery 2 separated td's.
<div style="width: 100%; min-height: 10px; display: inline;" ondblclick="edv.show_edit('google_keyword_1_c','varchar')" class="div_value" id="google_keyword_1_c_detailblock" target_id="google_keyword_1_c"> <span style="background: none repeat scroll 0% 0% whitesmoke;" class="sugar_field" id="google_keyword_1_c_span">qweqweqw</span> </div> </td> <td> <span style="display:inline" id="spany_span"><a href="http://www.google.com/search?q=qweqweqw varna vn" target="_blank">google</a> </span>
they 5 fields , setting jquery each piece of code:
$('div#google_keyword_'+i+'_c_detailblock').wrap('<table><tbody><tr><td>').css('display','table').after('<div style="display: table"><span style="display: inline" id="spany"><a href="' + url + '" target="_blank">google</a></span></div>');
my problem when try $('#google_keyword_1_c_detailblock').wrap('<td>');
it's putting <div>
should end </div>
set before closing <tbody>
, </tr>
.
this desire html want achieve of jquery.
<table> <tbody> <tr> <td> <div style="width: 100%; min-height: 10px; display: inline;" ondblclick="edv.show_edit('google_keyword_1_c','varchar')" class="div_value" id="google_keyword_1_c_detailblock" target_id="google_keyword_1_c"> <span style="background: none repeat scroll 0% 0% whitesmoke;" class="sugar_field" id="google_keyword_1_c_span">qweqweqw</span> </div> </td> <td> <span style="display:inline" id="spany_span"><a href="http://www.google.com/search?q=qweqweqw varna vn" target="_blank">google</a> </span> </td> </tr> </tbody>
Comments
Post a Comment