D
Dante
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.getElementsByTagName("TABLE")[4].childNodes[0].childNodes[0].childNodes[0].childNodes;
var base = document.getElementsByTagName("PRE")[0];
var link = document.createElement("SPAN");
var text = document.createTextNode("Copy All");
link.appendChild(text);
for (var i=0;i<where.length;i++) {
if (where.nodeName == 'PRE'))
document.body.insertBefore(link,where);
}
}
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.getElementsByTagName("TABLE")[4].childNodes[0].childNodes[0].childNodes[0].childNodes;
var base = document.getElementsByTagName("PRE")[0];
var link = document.createElement("SPAN");
var text = document.createTextNode("Copy All");
link.appendChild(text);
for (var i=0;i<where.length;i++) {
if (where.nodeName == 'PRE'))
document.body.insertBefore(link,where);
}
}
Thank you so much, Dante.