Kod
<script>
function CopyToClipboard(id)
{
var r = document.createRange();
r.selectNode(document.getElementById(id));
window.getSelection().removeAllRanges();
window.getSelection().addRange(r);
document.execCommand('copy');
window.getSelection().removeAllRanges();
}
</script>
function CopyToClipboard(id)
{
var r = document.createRange();
r.selectNode(document.getElementById(id));
window.getSelection().removeAllRanges();
window.getSelection().addRange(r);
document.execCommand('copy');
window.getSelection().removeAllRanges();
}
</script>
O ile dobrze działa to na takim kodzie:
to na inputach już działać nie chce.
Ktoś wytłumaczy dlaczego?
<input id="code-346e29251" type="text" class="form-control form-control-user" value="346e2925162e85954886a9021f32da7b" readonly="">