Tuesday, 27 August 2013

Access members within function/setting them from outside

Access members within function/setting them from outside

I would really like to do this:
var Html = function() {
alert('internal: ' + this.val);
};
Html.val = "x";
alert('external: ' + Html.val);
Html();
but it doesn't work. why? how can I get the function code to see values
set after its creation?

No comments:

Post a Comment