I have a series of calls to various jQuery methods and I was just wondering if there was a way to clean this code up, turn it into a function that I pass the selectors into, or anything else that could make the the code more manageable/maintainable. What I have is a very long list of lines of code like these with a lot of repetition:
...
$('#boxcolor').on('change', function() {
$('header').css('background-color', $('#boxcolor').val());
});
$('#color').on('change', function(){
$('header').css('color',$('#color').val());
});
$('#size').keyup(function() {
$('header').css('font-size', $('#size').val() + 'px');
});
...
Any suggestions would be great, thanks.