javascript - How to append html div to a table in response to jQuery getJSON -
javascript - How to append html div to a table in response to jQuery getJSON -
i'm trying following:
$.getjson("script/course_session.php", data, function(data) { $.each(data, function(i, item) { var $tr = $('<tr>').append( $('<td>').text(item.start_date + " - " + item.end_date), $('<td>').text( '<div class="col-md-3 btn-buy animated fadeinright"><a href="#" class="btn-u btn-u-sm enroll-button"><i class="fa fa-university"></i> register</a></div>') ).appendto("#session-table"); }); });
the intent beingness accomplish next (i'm using bootstrap):
however, how gets printed:
what right way render html?
you have utilize .html(...) instead of .text(). , " instead of quot;
javascript jquery html css twitter-bootstrap
Comments
Post a Comment