79623821

Date: 2025-05-15 16:25:43
Score: 1
Natty:
Report link

It looks like @Brett Mchdonald is correct. You have a typo in your post I'd check the spelling of the grid-template-columns

   // create a reference to linked stylesheet
    const stylesheet = document.styleSheets[0];
    const rules = stylesheet.cssRules || stylesheet.rules; 
    
    // loop through the style sheet reference to find the classes to be modified and modify them

    for (let i = 0; i < rules.length; i++) {
        if (rules[i].selectorText === '.grid-container') {
            rules[i].style['background-color'] ='yellow';
            rules[i].style['grid-template-columns'] = 'auto auto auto';
            break;
        }
    }
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Brett
  • Low reputation (1):
Posted by: Jesse Vanderwerf