Reputation: 332
I have a javascript object with a defined function
var obj = {
addOne : function( arg1 ) { return arg1++; }
};
At an onclick event, I want to display the function as plaintext. That is to say I want to somehow get the plaintext string 'function( arg1 ) { return arg1++; }' from obj so that I can display this string in a div block.
How do?
(To be clear, I am fine with printing out the string in an html element, but unclear on how to get the desired string in the first place)
Upvotes: 0
Views: 142