Code to copy text to clip board
2 posters
Page 1 of 1
Code to copy text to clip board
Hi,
I'm looking for a code that copies text to the users clip board when the button is pressed.
SO i want a button that when pressed its Copies a Email address to the users clip board. Any on know how to do this???
I'm looking for a code that copies text to the users clip board when the button is pressed.
SO i want a button that when pressed its Copies a Email address to the users clip board. Any on know how to do this???
Re: Code to copy text to clip board
Sir Mayo, with Google Chrome and Firefox this is not allowed, only with Internet Explorer is this allowed with code.
A code would look like:
Then on the button you do
<input value="http://www.sajithmr.com" onclick="select_all(this)" name="url" type="text" />
A code would look like:
- Code:
function select_all(obj) {
var text_val=eval(obj);
text_val.focus();
text_val.select();
if (!document.all) return; // IE only
r = text_val.createTextRange();
r.execCommand('copy');
}
Then on the button you do
<input value="http://www.sajithmr.com" onclick="select_all(this)" name="url" type="text" />
Similar topics
» How to copy text in spoiler?
» Copy, Pasting Text & Embeding Video issues in WYSIWYG mode!?
» code no copy web
» Copy and paste embed code...
» "Wrap Around Text" Code ?
» Copy, Pasting Text & Embeding Video issues in WYSIWYG mode!?
» code no copy web
» Copy and paste embed code...
» "Wrap Around Text" Code ?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum