...

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



joesph
04-23-2006, 11:13 AM
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.

PremiumBlend
04-23-2006, 01: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';

Kor
04-25-2006, 11:04 AM
opener.document.getElementById(span_id_open).firstChild.nodeValue = count;

or

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum