I have a function that takes an element in which it should work as an element parameter
function changeColor(element){ $(element).find('.middleBox').each(function(){ $(this).
and I call it that way
changeColor($(document)); //this applies it to the whole document changeColor($('#sectionOne')); //this applies it to only part of the document
I want to change it from the format in which it takes its object as a parameter for this format. How to do it?
$('#sectionOne').changeColor(); $(document).changeColor();
javascript jquery
twitter
source share