const main = document.querySelector('main');
const n = '40px';
const div = document.createElement('div');
div.setAttribute('class', 'grid');
main.appendChild(div);
div.setAttribute('style', 'background-color: #f9f9f9; width: n; height: n');
I want n to refer to the value of 40px above. Eventually n will be a user input. (Although I have no idea how I'll get a number to convert to a string+px...but that's an issue for another time).