What I'm trying to do is crate a button that changes the background color of the div container with the color that was specified on the tags. When I run this on my console it says that my variables have not been specified.
<div class="grid1">
<input id="bgR" type="text"></input>
<input id="bgG" type="text"></input>
<input id="bgB" type="text"></input>
<input id="change_bgColor" type="button" value="Change Background Color"></input>
</div>
$('#change_bgColor').click(function(){
var rColor = $('#bgR').val();
var gColor = $('#bgG').val();
var bColor = $('#bgB').val();
var newColor = "rgb("+ rColor +","+ gColor +"," + bColor + ")";
$('#container').css("background-color", newColor);
});
My code does contain a #container I just didnt post it here because I dont want to post all of my code.