Results 1 to 4 of 4

Thread: removeChild() isn't working

  1. #1
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default removeChild() isn't working

    Hi experts,

    I wanted to remove the character " | " typed from keyboard on a ASPX page. But the " | " is on ASPX page which cannot be accessed. Can javascript remove the " | " listed on the ASPX page?

    <td class="prog-asset"> | <a href="/global_id=002350">Video</a> | <a href="global_id=002350">Photography</a> | <a href="global_id=002350&">Press Releases</a> |
    </td>

    Any helps would be gratefully appreciated it!!!

  2. #2
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    687
    Thanks
    1
    Thanked 113 Times in 111 Posts

    Default

    Hi there begeiste,

    and a warm welcome to these forums.

    does this help...
    Code:
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    
    <title></title>
    
    <script type="text/javascript">
    
    function init(){
       var cells=document.getElementsByTagName('td');
    for(var c=0;c<cells.length;c++) {
    if(cells[c].className=='prog-asset') {
       cells[c].innerHTML=cells[c].innerHTML.replace(/[|]/g,'');
       }
      }
     }
       window.addEventListener?
       window.addEventListener('load',init,false):
       window.attachEvent('onload',init);
    
    </script>
    
    </head>
    <body>
    
    <table><tr>
    <td class="prog-asset"> | 
    <a href="/global_id=002350">Video</a> | 
    <a href="global_id=002350">Photography</a> | 
    <a href="global_id=002350&">Press Releases</a> |
    </td>
    </tr></table>
    
    </body>
    </html>
    
    coothead

  3. #3
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks Sir. It works fine.

    Much appreciated!

  4. #4
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    687
    Thanks
    1
    Thanked 113 Times in 111 Posts

    Default

    No problem, you're very welcome.

Bookmarks

Posting Permissions

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