slj90 Posted May 23, 2014 Share Posted May 23, 2014 $('input#name-submit').on('click', function() { var name = $('input#name').val(); if ($.trim(name) != '') { $.post('play2.php', {name: name}, function(data) { $('div#name-data').text(data); }); } }); data contains html code but when it is displayed it is displayed as text and shows the html, how can I get the html code to function properly? thanks Link to comment https://forums.phpfreaks.com/topic/288724-stop-displaying-html-as-text/ Share on other sites More sharing options...
Frank_b Posted May 23, 2014 Share Posted May 23, 2014 Try to use .html() instead of .text() Link to comment https://forums.phpfreaks.com/topic/288724-stop-displaying-html-as-text/#findComment-1480658 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.