jQuery is a superset of JavaScript. It IS JavaScript! Just a neat tool set for JavaScript so widely used it's almost considered essential to many people.
That being said, jQuery selections are jQuery objects and have some specific properties. They aren't 100% compatible with normal DOM nodes. It's best to stick with one or the other. There are only rare cases where you need to use standard JavaScript anyway because jQuery has so many methods available to you. In this case use:
$(function(){
var b= $('#p');
b.text("wow");
});
If you really want to get the DOM node out of that you'll have to use the array reference which can give you the node, but this means that either you'll only effect the first element such as in this case:
$(function(){
var b= $('#p');
b[0].innerHTML = "wow";
});
or you'll have to loop through and change each element one by one like this:
$(function(){
var b= $('#p');
for(var i = 0; i < b.length(); i++) {
b[i].innerHTML = "wow";
}
});
b[0].innerHTML="wow";the jquery function returns an array every time even if there is only one element.