Just a heads up, I've been attempting to customize the appearance of my HTML document through my JavaScript file. Specifically, I am currently using a forEach loop to style my buttons, but for some reason, they remain positioned right beside each other without any changes taking effect. Can anyone shed some light on what might be causing this issue within my loop?
const togglePen = document.createElement('button')
togglePen.innerText="Toggle pen"
togglePen.classList.add("common")
const toggleColor = document.createElement('button')
toggleColor.innerText = 'Toggle color'
toggleColor.classList.add("common")
const eraser = document.createElement('button')
eraser.innerText = 'Eraser'
eraser.classList.add("common")
const reset = document.createElement('button')
reset.innerText = 'Reset'
reset.classList.add("common")
//Implementing button styles
buttons = document.querySelectorAll(".common")
buttons.forEach(button => {
button.style.padding = '10px'
});
buttonMenu.append(togglePen, toggleColor, eraser, reset)