Jump to content

Javascript to change a css class...


RIRedinPA

Recommended Posts

Here is the jQuery version of that. Just include the jQuery library in the head

 

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>

 

Then add this.

 

<script  type="text/javascript">
$(document).ready(function(){
  $('#content p.checkbox').hover(function(){
    $(this).css('bacground', '#ff0000');
  }, function(){
    $(this).css('bacground', '#ffffff');
  });
});
</script>

 

A bit extensive to include a library for one functionality.

 

Anyway, not sure if this works:

 

#content p.checkbox:hover { 
  background-color: #ff0000 !important;
}

 

I don't even understand the concept of this. You want to change the checkbox background color?

A bit extensive to include a library for one functionality.

 

Anyway, not sure if this works:

 

#content p.checkbox:hover { 
  background-color: #ff0000 !important;
}

 

I don't even understand the concept of this. You want to change the checkbox background color?

 

That will work but not for IE

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.