I am creating a function like so:
function ajaxinate(divId) {
('divId .anotherDiv').toggle();
}
Can someone please tell me how to decorate the divId parameter within the function so that it interpolates from what’s passed in? For example, when I call
ajaxinate('#myAjaxinatedDiv');
I would like the function to look like:
('#myAjaxinatedDiv .anotherDiv').toggle();
For some reason, I can’t get the variable assigned as divID to interpolate into the function. I’ve tried decorating divId with singe quotes and + signs and just about every possible combination of the sort…
Thanks!
Pass in the variable to the string:
(Also, I’m assuming you meant to use
$for jQuery.)