I'm trying to change all h1
's background color to red for example.
At my popup.js that is linked to popup.html I've added this code:
chrome.tabs.executeScript(null,
{code:"document.getElementsByTagName('h1').style.backgroundColor='red';"});
it works fine with document.body
, but I have no idea how to make it works with getelementbytagname
Also I'd like to add some text in the h1
container.