In this particular instance:
$('#color1').on('click', function () {
$('#JS1').css('background-color', $('#color1').val());
});
The
css()
method is used to apply a style property to the element, and the
val()
method can be used against form input elements to retrieve the value entered.
These are very basic jQuery functions, I recommend getting acquainted with the
jQuery API Documentation[
^] which should provide you with all of the information you need.