Mirror click

Mirror a click event from one element to another. Create synchronized actions with a single click.

Copy the Mirror click <script> and paste into the <head> of your page

<!-- [WebTricks by CodeRaccoons] - Mirror clickĀ -->
<script async src="https://cdn.jsdelivr.net/gh/TheCodeRaccoons/WebTricks@1/" ></script>
Copy Script

Required attributes

Optional
Defines the target element that will be clicked when the trigger is activated.
Attribute to add
Name
wt-mirrorclick-element
Value
target{index}
Instructions

Assign this attribute to the element that should be clicked programmatically.

Where?
Target element
How does it look?
Optional
Defines the trigger element that simulates a click on a target element.
Attribute to add
Name
wt-mirrorclick-element
Value
trigger
Instructions

Assign this attribute to the element that will trigger a click on the target.

How does it look?

Optional Attributes

No items found.

Working examples

See the Pen WT Mirror Click by Code Raccoons (@jorchie) on CodePen.