Home  >  Article  >  Web Front-end  >  jquery tutorial on using the jquery.zclip plug-in to copy objects_jquery

jquery tutorial on using the jquery.zclip plug-in to copy objects_jquery

WBOY
WBOYOriginal
2016-05-16 17:10:581593browse

Copy code The code is as follows:



Copy code The code is as follows:

$(function(){
$(' #copy_input').zclip({
path: 'js/ZeroClipboard.swf',
copy: function(){//Copy content
return $('#mytext').val();
                                                                                                                                                                                                                                                                                       afterCopy: function(){//Copy successfully ('Copied successfully');
}
});
});


It is worth noting that if the copied content comes from input box input, textarea, etc., use the copy object:

copy: function(){
return $( '#mytext').val();
}


If the copied content comes from page elements div, p, etc., use the copy object:

copy: $('#mytext').text( );


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn