tags:

views:

33

answers:

2

Does anyone know how to the change the background of a DIV when the a <input> is clicked?

+2  A: 

using jquery:

$('#input_id').click(function() {
  $('#div_id').css('background-image','url')
});
Sergey
A: 

Something like this:

var input = document.getElementById("my_input_id");

input.onclick = function ()
{
    document.getElementById("my_div").style.backgroundColor = "blue";
};
svanryckeghem