JQuery Change background color based on radio button Click Event-JQuery Script

In this article,I will Explain how to change background colour based on Radio button value in JQuery and how to use Radio button Click event using Javascript.I want to change the background Colour to the latest radio button clicked value.
I have written radio buttons background color change script using JQuery.

Example:Change div /Span background Colour color with active chcecked radio button.

<!DOCTYPE html>
<title>how to change the background color of a radio button.<</title>
 <script src="http://code.jquery.com/jquery-latest.js"></script>
<DIV><b>Change background color on radio select</b></DIV>
    <input type="radio" name="1" value="Red" class="hi">
    <span id="Red">Red</span>
    <input type="radio" name="1" value="Green" class="mid">
    <span id="Green">Green</span>
    <input type="radio" name="1" value="Blue" class="lo">
    <span id="Blue">Blue</span>
$("input").click(function() {

var id=$(":checked").val();


Change background color on radio select