Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, in my asp.net website i want to change the color of my page controls according to the color selection. suppose if i select red color then all my website page's #4c66a4 colored controls should change into red color. i am using below jQuery code but it is not working correctly.anyone please help me regarding this.


JavaScript
function fnChangeColor() {

         for (i = 0; i < $('*').length; i++) {
             ctrl = $('*')[i];
             prevColor = $('*')[i].style.color;

             if (prevColor == "#4c66a4")
                 ctrl.style.color = 'red';
             else
                 ctrl.style.color = prevColor;
         }
  }
Posted
Updated 30-Jan-14 22:29pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900