Can clipboard.js realize the method of batch replication?

<input type="text" id="fuzhi" value="  ">
<button data-clipboard-action="copy" data-clipboard-target="-sharpfuzhi"title=""></button>
    <input type="text" id="fuzhi2" value="  ">
    <button data-clipboard-action="copy" data-clipboard-target="-sharpfuzhi2"title=""></button>
    <input type="text" id="fuzhi3" value=" ">
    <button data-clipboard-action="copy" data-clipboard-target="-sharpfuzhi3"title=""></button>
    <input type="text" id="fuzhi4" value=" ">
    <button data-clipboard-action="copy" data-clipboard-target="-sharpfuzhi4"title=""></button>
id= " fuzhi (variable)"
data-clipboard-target= "- sharp fuzhi (variable)"

is there a way to copy all the contents of value with one click

Apr.29,2021

if you want to set text, dynamically, you need to return a string.

new Clipboard('-sharpfuzhi', {
  text: function() {
    return `
        
        
       
      `;
  }
});

it is something like this. The text is prepared in advance or obtained in real time in the callback function

.
Menu