You can find an example of getting inner text from a <p>
tag here. Same thing with a <span>
.
To set it you just need to assign the InnerText property.
If your javascript snippet is out of scope (in a function etc) use the GetElementById method of the document global object to retrieve your <p>
or <span>
or whatever - in fact you can do this with any element provided you assign an id to the element.