MonkeyOnARock MonkeyOnARock - 1 year ago 131
Javascript Question

Insert value of object into span tag

I have an object:

message: {
text: Here is some text

I want to insert it into a span tag like this:


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?

Answer Source

Give something id to span

<span id="span"></span>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download