Sorry for the subject line, but I wasn't sure how exactly to phrase it. I'd like to automate this to a function $('#progress-row-1 .indicator).css('width', 100); the following way:
setWidth($('#progress-row-1'), 100);
So I only pass the ID of the element to the function. The element has only one child with a class called ".indicator". So...
In the function, I'd like to set the CSS width of the element who has a class named "indicator":
function setWidth(obj, size) {
$('obj .indicator').css('width', size);
}
I know the $('obj .indicator') syntax is wrong, but I don't know what is the correct one. How would I access the passed object's child who has a class named ".indicator" such way? Can anyone help me out? Thank you!