I have an object:
message: {
text: "Here is some text"
}
I want to insert it into a span tag like this:
<span>message.text</span>
This won't print 'Here is some text', instead it will just show 'message.text' on the webpage. How can I get it to show the actual contents of the object?
Give something id to span
<span id="span"></span>
$("#span").text(message.text);
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