Tonight I started writing a script that places a "Copy All" link
before every PRE tag. The link would copy the code in the pre tag. I
can't get this script to work. Can anyone help me?
Here is my script:
function makeIt() {
var where = document.getEle mentsByTagName( "TABLE")[4].childNodes[0].childNodes[0].childNodes[0].childNodes;
var base = document.getEle mentsByTagName( "PRE")[0];
var link = document.create Element("SPAN") ;
var text = document.create TextNode("Copy All");
link.appendChil d(text);
for (var i=0;i<where.len gth;i++) {
if (where[i].nodeName == 'PRE'))
document.body.i nsertBefore(lin k,where[i]);
}
}
Thank you so much, Dante.
before every PRE tag. The link would copy the code in the pre tag. I
can't get this script to work. Can anyone help me?
Here is my script:
function makeIt() {
var where = document.getEle mentsByTagName( "TABLE")[4].childNodes[0].childNodes[0].childNodes[0].childNodes;
var base = document.getEle mentsByTagName( "PRE")[0];
var link = document.create Element("SPAN") ;
var text = document.create TextNode("Copy All");
link.appendChil d(text);
for (var i=0;i<where.len gth;i++) {
if (where[i].nodeName == 'PRE'))
document.body.i nsertBefore(lin k,where[i]);
}
}
Thank you so much, Dante.
Comment