I have a script with which at a certain point I'm getting HTML(data) with Ajax call. I have to turn this HTML in to plain text like this:
$("#div").text(data);
I now want to turn this around and make the text HTML again. I there an easy Jquery method of doing this? I tried:
$("#div").text(data).end().html();
No luck.
Change Default Email Format for Sending Messages Go to File > Options. In the Outlook Options dialog box, select Mail. In the Compose messages section, select the Compose messages in this format dropdown arrow and select either HTML, Plain Text, or Rich Text. Select OK to close the Outlook Options dialog box.
You would need to hold onto the original response to do this...
$("#hiddendiv").html(data);
$("#div").text(data);
Then you could get it back out...
var html = $("#hiddendiv").html();
Update based on comment...
You can remove that element before you display it...
var html = $(data);
$('#cookiediv', html).hide();
$('#div').html(html);
Where the cookie message has id="cookiediv"
- you may need to adjust the selector to get to this div, but it is almost certainly possible to grab it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With