Copy Attribute

Copy an attribute here


<div data-js-copy-item="example" data-js-copy-data="The copied attribute">Copy an attribute here</div>
            <button class="c-button u-margin__bottom--3 c-button__filled c-button__filled--default c-button--md" target="_top" data-js-copy-target="example" type="button" aria-label="Copy another elements attribute" data-uid="673ed4e5b52ad">   
     <span class="c-button__label">         
        
                    <span class="c-button__label-text ">
                Copy another elements attribute
            </span>
        
    </span> </button>
        <br><br>

             <button class="c-button u-margin__left--0 c-button__filled c-button__filled--default c-button--md" target="_top" data-js-copy-target="self" data-js-copy-data="Copy this data" data-js-copy-success="The the text was copied successfully." type="button" aria-label="Copy self" data-uid="673ed4e5b5306">   
     <span class="c-button__label">         
        
                    <span class="c-button__label-text ">
                Copy self
            </span>
        
    </span> </button>    <div class="u-margin__top--4">
    <input type="text" placeholder="Paste copied content here" class="u-width--100">
    </div>

Attributes

Copies an attribute from another element (or itself) to clipboard.
If the the target attribute is set to 'self'. It copies its own data-js-copy-data.

Blade component parameters

Attributes Description Values
data-js-copy-target The element you want to trigger the copy functionality
data-js-copy-item The element to copy it from
data-js-copy-data The content to copy
data-js-copy-success Success feedback to the user
data-js-copy-error Error feedback to the user