How to add Copy to clipboard functionality in ExtJs? It's working fine with IE browser but not Firefox, What else has to be altered to make it work in FF browser.
Code:
function selectCopy(txt,txtId)
{
Ext.getCmp(txtId).focus();
Ext.getCmp(txtId).selectText();
var s = document.getElementById(txtId).value;
var div = document.createElement('div');
div.innerText = '"' + s + '"';
document.body.appendChild(div);
if (window.clipboardData && clipboardData.setData){
window.clipboardData.setData('text', s);}
else
return (s);
}