如何复制html div内容并使用javascript jquery粘贴
问题描述:
大家好
我正在开发一个移动应用程序(phonegap应用程序),其中我有一个div,内容是从数据库加载的。我希望通过长按来复制div中的内容,并在我的手机中的应用程序中粘贴,如短信电子邮件等。
hi all
I am developing a mobile application(phonegap application) in which i have a div, the contents are loaded from database. i want to get copy the contents in the div by long press and make paste in an applications in my mobile like sms email etc.
答
你可以使用div.innerhtml / div.innerText属性基于您对longpress按钮事件代码的需要。使用上面的属性来复制div的内部数据。
you can use div.innerhtml / div.innerText property based on your need on longpress button event code. use above property to copy inner data of the div.