Home > front end >  JQuery replication issues
JQuery replication issues

Time:12-13

 actions. Push (' & lt; A href="javascript: void (0)" onclick="copy1 (\ '+ row Id +' \ ')" & gt;  Replication activity links & lt;/a> '); 

 function copy1 (id) {
T=var url + id;
T.s well ();
Document. ExecCommand (" Copy ");//browser copy command
Alert (" copy success!" );
}

I use a key to achieve such a tag button to copy the url links, introduced to the bank in the js object id, and then add static url to generate a link is copied to the clipboard, but the t attribute is a string, whether to switch to the HTMLElement, how to turn around the great god, I'm going crazy, or there are other ways to also go, demand is used only the button and the object id to realize...

CodePudding user response:

Write a textarea/input set transparent, the t value assignment to the dom can copy the dynamically create dom

CodePudding user response:

https://blog.csdn.net/ChisameMuko/article/details/100840201

Have a look at the

Copy of the principle is to create a hidden textarea

T.s well (); T here is certainly textarea object string must be no good

CodePudding user response:

Yes, is too strong
  • Related