From 865b46c34cf0cf7fa3e387e894891d616f6386bf Mon Sep 17 00:00:00 2001 From: Sita Ganesh Date: Thu, 2 Jan 2025 22:35:29 +0530 Subject: [PATCH] Updated pencil button to first Updated the pencil button at the beginning of the buttons --- JavaScript/Mini Paint/script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/JavaScript/Mini Paint/script.js b/JavaScript/Mini Paint/script.js index 8661843..8ccf247 100644 --- a/JavaScript/Mini Paint/script.js +++ b/JavaScript/Mini Paint/script.js @@ -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;