Skip to content

Instantly share code, notes, and snippets.

@apelmahmudDev
Created August 11, 2021 15:22

Revisions

  1. apelmahmudDev revised this gist Aug 11, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion event-delegation-example.js
    Original file line number Diff line number Diff line change
    @@ -3,5 +3,5 @@ const palette = document.querySelector('#palette');
    palette.addEventListener('click', handleColorClick);

    function handleColorClick(el) {
    console.log(`You clicked on this color: ${el.target.style.backgroundColor}`);
    console.log(`You clicked on this color: ${el.target.style.backgroundColor}`);
    }
  2. apelmahmudDev created this gist Aug 11, 2021.
    7 changes: 7 additions & 0 deletions event-delegation-example.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    জাভাস্ক্রিপ্ট
    const palette = document.querySelector('#palette');
    palette.addEventListener('click', handleColorClick);

    function handleColorClick(el) {
    console.log(`You clicked on this color: ${el.target.style.backgroundColor}`);
    }