color of button

0 Jeff Gong · September 15, 2015
How would you change the color of a button 

Post a Reply

Replies

Oldest  Newest  Rating
+1 Casper Hollemans · September 16, 2015
I'd recommend to use the jquery framework.
It's really easy to make your website interactive with it.

for example (the button)

$('class/div').css('color', 'color you want');

If I'm right you are also able to use HTML tags in it like the button tag like
$('button').css('color', 'color you want');

I'd recommend to google about jquery because it's a very often an usefully framework 

Hope it helps

-Greets
0 Milan Obrenovic · September 15, 2015
http://lmgtfy.com/?q=javascript+change+color+of+a+button
0 Jeff Gong · September 16, 2015
THanks
0 Brotsky Tv · September 17, 2015
try this script :

<script>
   var count = 1;
   function setColor(btn, color) {
       var property = document.getElementById(btn);
       if (count == 0) {
           property.style.backgroundColor = "#FFFFFF"
           count = 1;        
       }
       else {
           property.style.backgroundColor = "#7FFF00"
           count = 0;
       }
   }
</script>


For more Javascript tutorials : https://www.brotsky.tv/category/javascript/
  • 1

Javascript

107,048 followers
About

A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.

Links
Moderators