Article
Double click list item to change button color.
https://cdn.jsdelivr.net/npm/[email protected]/dist/js.cookie.min.js
Copy to clipboard
You can also apply the dblclick() function to one element and change another element on the same page.
The following example changes the button color according to list item that is double clicked. https://raw.githubusercontent.com/finsweet/jqueryCourse/main/jquery%20events/ex15.js?actionable=true
<script>
$(document).ready(function(){
XT1
});
</script>
$(document).ready(function(){
XT1
});
</script>
Copy to clipboard
Live demo
<div id="minidivpage" class="example-live"><h4 class="heading-4">Colours in a webflow list:</h4><ul role="list" class="list"><li>Purple</li><li>Blue</li><li>Magenta</li></ul><a id="alertButton" href="#" class="w-button">Button alert</a></div>
<script>
$(document).ready(function() {
XT1
});
</script>
$(document).ready(function() {
XT1
});
</script>
Copy to clipboard
Press the Run Demo button to execute the scripts above.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.