I am using JQuery Dialog to display some text which has HTML tag included:
<div id="dialog" style="display: none">
<p id='infoShow'></p>
</div>
The JQuery which displays the data is:
function test(element) {
$("#infoShow").html($(".gLine", $(element).closest("tr")).html());
$("#dialog").dialog({
title: "View Guideline",
buttons: {
Ok: function () {
$(this).dialog('close');
}
},
modal: true,
width: "450px"
});
}
It is invoked by an ASP LinkButton:
<asp:LinkButton runat="server" ID="btnShow3" CssClass="btnSearch3" Text="VIEW" OnClientClick="javascript:test(this);return false;"></asp:LinkButton>
Although I am using the .html()
to display the output, it is still showing the HTML tags instead of the output:
How can I modify the code so it generates the HTML tag instead of just displaying as plain text?
.html
statement into smaller pieces, run in the debugger and see what's what. In particular, how did a.closest("tr")
bring back the entire document? Where did thehtml
tag come from? – Bahamas