[jQuery] Probably obvious, but...I can't store text in function using $(...) format

[jQuery] Probably obvious, but...I can't store text in function using $(...) format


I receive text from an ajax call. I want to store it in a DIV, let's
say 'id="xxx".
If I do the following, nothing happens:
$("#xxx").val(msg);
or
$("#xxx").innerHTML=msg;
BUT, if I use the DOM, it works!
document.getElementById("xxx").innerHTML=msg;
How can I use the $(...) format within functions?
TIA