-3

How do I do the color color customization in HTML5? Examples can be found at http://perkins.org/ whereby they have a color contrast option on the top of their page.

Thank you!

1 Answers1

0

Um, mark all the elements you want to change as class "contrast" and then change the color and the background color:

var elements = document.getElementsByClassName('contrast');
for (var i = 0; i < elements.length; i++) {
  elements[i].style.color = newcolor;
  elements[i].style.background = newbackground;
}
csander
  • 1,385
  • 10
  • 11
  • If this solves your issue, please accept the answer by clicking the check mark on your left as it will promote user "csander". – I am Cavic Jan 10 '14 at 01:59
  • Thank you so much! I truly appreciated the works that you guys have done! It saves me a lot of time trying to figure out the process. – user3180023 Jan 16 '14 at 03:33