What’s wrong with my jquery script?
Here’s the script
function debug(message){
$("body").append("<div id=\"debug\">"+ $(message) +"</div>"):
}
debug("show this debug message in the div");
Here’s the resulting html I get
<div id="debug">[object Object]</div>
The html that I expect is this
<div id="debug">show this debug message in the div</div>
You are pasting an object in, $(message), instead of the variable message. Try this: