Cannot change style of HTML elements using jQuery by content script

Posted by Moctava Farzán on Stack Overflow See other posts from Stack Overflow or by Moctava Farzán
Published on 2012-08-29T09:30:37Z Indexed on 2012/08/29 9:38 UTC
Read the original article Hit count: 221

I'm writing an extension for chrome as "Content script". My extension should change the background color of google home page (https://www.google.com) I wrote this code (including jquery):

$(".gsib_a").style="background:#FF0000";

But not worked. I'm sure I added jQuery to content script, and the manifest.json file is set. I am sure because this code works:

$(".gsib_a").hide();

And I am sure changing style of the element with class of gsib_a is exactly what I need and affects. Because I've tested it by Chrome Developer Tools.

Okay, who knows the problem?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery