Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2006
    Location
    SEOUL KOREA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to javascript DOM the text between span's?

    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.

  • #2
    Regular Coder PremiumBlend's Avatar
    Join Date
    Apr 2006
    Location
    Marion, Iowa
    Posts
    201
    Thanks
    0
    Thanked 13 Times in 13 Posts
    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';

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    opener.document.getElementById(span_id_open).firstChild.nodeValue = count;

    or

    opener.document.getElementById(span_id_open).firstChild.data = count;
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •