I am developing an application in Rails 3 where I have a text field which contains a URL:
<input type="text" readonly="readonly" value="<%= linkbunch_url(@link.link) %>" class="span4" id="url_copy" />
Next to this I have a button:
<button type="button" id="copy_link" class="btn btn-success"><i class="icon-share" ></i> Copy To ClipBoard</button>
When someone clicks on this button, I want the url in the text field to be copied into the clipboard. How do I do this?