Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

jquery reset

Go to solution Solved by elpiop,

The same way you set the color to gray. Though if you just want to change the color when it is pressed you can use :active pseudo class

https://developer.mozilla.org/en-US/docs/Web/CSS/:active

<script type="text/javascript">
		$(document).ready(function(){
			$('#follow').click(function(){
				$('#follow').css('background', 'gray');})
			})
			
    </script>

how do I make it so the button changes back to the normal background color after clicked not on refresh?

Link to post
Share on other sites
31 minutes ago, elpiop said:

The same way you set the color to gray. Though if you just want to change the color when it is pressed you can use :active pseudo class

https://developer.mozilla.org/en-US/docs/Web/CSS/:active

omg,thanks! that works absolutely amazing ,no need for scripts and jqueries. 

maybe on the compatibility version though I am gonna keep my scripts because I think this will be more compatible with IE(it's some sort of javascript). But for the modern version I am definitely using active that's amazing how did I not find that?thanks a  lot,appreciate it! it works like a charm now!

 

Link to post
Share on other sites
4 hours ago, stefanmz said:

maybe on the compatibility version though I am gonna keep my scripts because I think this will be more compatible with IE

The very link @elpiop mentioned says the :active pseudoclass is supported by Internet Explorer from version 4. It's a pretty ancient feature.

Link to post
Share on other sites
5 hours ago, OrionFOTL said:

The very link @elpiop mentioned says the :active pseudoclass is supported by Internet Explorer from version 4. It's a pretty ancient feature.

oh nice I dind´t read that ok great so I can use it for that as well

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×