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 Quote Link to comment https://forums.phpfreaks.com/topic/288724-stop-displaying-html-as-text/ Share on other sites More sharing options...
Solution Frank_b Posted May 23, 2014 Solution Share Posted May 23, 2014 Try to use .html() instead of .text() Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.