Skip to content

Commit

Permalink
Updated pencil button to first
Browse files Browse the repository at this point in the history
Updated the pencil button at the beginning of the buttons
  • Loading branch information
SitaGanesh committed Jan 2, 2025
1 parent ad9adc7 commit 865b46c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion JavaScript/Mini Paint/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ const pencil=document.createElement('button');
pencil.id='pencil';
pencil.textContent='Pencil';
//Button is created
toolbar.appendChild(pencil);
const firstButton = toolbar.querySelector('button');
toolbar.insertBefore(pencil, firstButton);

document.getElementById('pencil').addEventListener('click', () => {
isEraser = false;
Expand Down

0 comments on commit 865b46c

Please sign in to comment.