Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
How to change header and footer color by selecting color picker and radio button?

i'm in big urge. The task may be simple, but not for me :)

I have a task to make color selection with color picker, then choose radio buttons of header or footer and submit button. I have already searched whole internet and have no answer how to write correct JS to make it work... HELP!

HTML -

<div class="colors" id="co">
    <label for="spp">Choose color:</label>
    <input type="color"/><br>
    <input name="CC"  type="radio" id="header" value="0"/>Header<br>
    <input name="CC" type="radio" id="footer" value="1"/>Footer<br>
    <button onclick="return changeColor();">Change</button>
</div>

JavaScript -

function changeColor() {
    var radio = document.documentElement["sp"];
    for (var i = 0; i < radio.length; i++) {
        if (radio[i].checked == true) {

            var newColor = radio[i].value;
            document.getElementById("changeColor").style.backgroundColor = newColor;
        return false;
        }
    }
}

Thank you in advance! :)

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!