View Full Version : how to javascript DOM the text between span's?

04-23-2006, 12:13 PM
i need to do something like this in javascript
where the parent window is <span id=itsid>PUT TEXT HERE DYNAMICALLY </span>

var span_id_open = 'itsid';
opener.document.getElementById(span_id_open).style.display = 'none';
opener.document.getElementById(span_id_open).style.fontColor = 'red';
opener.document.getElementById(span_id_open).style.color = 'red';
opener.document.getElementById(span_id_open).nodeValue = count;
opener.document.getElementById(span_id_close).style.display = '';

but that doesn't work. it's probably not important if it's parent window or child window.
i can't find the right DOM values and functions to get and append that darn text into the spans.

04-23-2006, 02:02 PM
where the parent window is <span id=itsid>sample text</span>

var span_id_open = 'itsid';
opener.document.getElementById(span_id_open).innerHTML = 'sample text';

04-25-2006, 12:04 PM
opener.document.getElementById(span_id_open).firstChild.nodeValue = count;


opener.document.getElementById(span_id_open).firstChild.data = count;