Append html tag to table header Jquery -


i have kind of tr structure, need juqey add image beside link here structure have

<tr>   <th  class="k-header" data-role="sortable"><a href="#" class="k-link">one</a></th>   <th  class="k-header" data-role="sortable"><a href="#" class="k-link">two</a></th>   <th  class="k-header" data-role="sortable"><a href="#" class="k-link">three</a></th>   <th  class="k-header" data-role="sortable"><a href="#" class="k-link">four</a></th>   <th  class="k-header" data-role="sortable"><a href="#" class="k-link">five</a></th>   <th  class="k-header" data-role="sortable"><a href="#" class="k-link">six</a></th> </tr> 

what need inside href add hmtl tag this

 <th  class="k-header" data-role="sortable"><a href="#" class="k-link">one <p>new link</p></a></th> 

i have data attribute can element, how add new tag inside that, tables going ajax, , thing think of, maybe on() or live()

any idea? have :)

$(function() {     var target = $('[data-role~=sortable]');       target.live(function() {       }); }); 

just have use append() in jquery

 $(".k-link").append("<p>new link</p>"); 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -