PDA

View Full Version : removeChild() isn't working



begeiste
11-17-2011, 09:04 PM
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!!!

coothead
11-17-2011, 09:48 PM
Hi there begeiste,

and a warm welcome to these forums. ;)

does this help...


<!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

begeiste
11-17-2011, 10:55 PM
Thanks Sir. It works fine.

Much appreciated!

coothead
11-17-2011, 11:37 PM
No problem, you're very welcome. ;)