Question: I'm trying to edit some styles within style tag. Is there a way to get specific selector from style to modify? For example if I have:

```
<style>
  h1 {
    background-color: red;
  }
</style>

```

and I want to change background color to #123456 is there a way to change it with jquery? Or I have to write some function to work on $("style").text(); ?

Answer: 
This would work as long as the page doesn't change after its loaded:

```
$(function() {
  $("h1").css("background-color":"#123456");
});

```

If you really really wanted to edit the style then maybe something like this:

```
$(function() {
  $("style").each(function(){
   $(this).html($(this).html().replace("background-color: red","background-color: #123456" );
  });

});

```

But that seems like a really bad idea to me.
You don't use jQuery to access the CSS definitions, you use it to access the DOM element and change the style directly.

```
$('h1').css('background-color', '#123456');

```

<http://api.jquery.com/css/>