how to copy url from address bar to clipboard using jquery
This question already has an answer here:
location.href
will give you the URL following code will work for you.
$(document).ready(function(){
$('#div1').click(function(){
$("#url1").html(location.href);
});
});
click here for demo DEMO
check my new code i have done it using zclip
DEMO 2
Get the URL.
var pathname = window.location.pathname;
And follow these instructions to copy:
http://ready2gosoft.com/jquery-javascript/copy-clipboard-javascript.html
链接地址: http://www.djcxy.com/p/19734.html上一篇: 通过JavaScript进行剪贴板操作