Copy code code as follows:
Function Copytext () {
// Copy content
var txt = document.GetelementByid ("table2"). ROWS [1] .Cells [0] .innerHtml;
// Remove the space
txt = txt.replace (//, "");
// Remove the bank
txt = txt.replace (/<br> <br>/, "");
if (Window.clipboardData) {
Window.clipboardData.Cleardata ();
Window.clipboardData.Setdata ("Text", TXT);
Alert ("It has been successfully copied to the cutting board!");
} else if (navigator.useragent.indexof ("opera")! = -1) {
Window.Location = txt;
} else if (window.netscape) {
try {
Netscape.Security.privilegeManager.enablePrivilege ("UniversalXPConnect");
} Catch (e) {
Alert ("" Rejected by the browser!/N, enter the 'About: config' in the browser address bar and press Enter/N and then set the 'signed.applets.codebase_princport' to 'true' ");
}
var clip = components.classes ['@mozilla.org/widget/clipboard ;1' ].createInstance (Components.interfaces.nsiclipboard);
if (! Clip) Return;
Var Trans = Components.classes ['@Mozilla.org/widget/transferable; 1..createInstance (Components.interfaces.nsitransferable);
if (! Trans) Return;
Trans.adddataFlavor ('Text/Unicode');
var str = new object ();
var len = new object ();
var str = components.classes ["@mozilla.org/supports-string ;1" ].createInstance (Components.interfaces.nsisUpportsstring);
var copytext = txt;
str.data = Copytext;
Trans.Settransferdata ("Text/Unicode", Str, Copytext.length * 2);
var clipid = components.interfaces.nsiclipboard;
if (! Clip) Return false;
Clip.setdata (trans, null, clipid.kglobalclipboard);
Alert ("It has been successfully copied to the cutting board!");
}
}