javascript - how to copy div content to another page

前端 未结 4 1262
心在旅途
心在旅途 2021-01-01 08:03

I would like to make an automatic copy of a div content from page 1 an paste it in a div on page 2 ? What\'s the best, easiest way to achieve this ?

4条回答
  •  伪装坚强ぢ
    2021-01-01 08:50

    Depending on your requirements, you could save the value of the div in the LocalStorage when they clip to copy, and then read it from LocalStorage when they click paste. That is the easiest.

    Unfortunately, if you want to actually put something on their system's clipboard, you will need to use Flash.

提交回复
热议问题