I'm trying to pass a jQuery selected object into a function, and the function will do a .html() on it.
Html:
<div id="box">this is a box</div>
Js:
var fillBox = function(box, text) {
box.html(text);
}
(function() {
var box = $("#box");
fillBox(box, "new text");
});
The box stays as "this is a box" and never gets updated, even tho the function is called. I even tried $(box).html(text) inside the function, but that doesn't fix it. Is this do-able?