I want to get nodeType and then compare it to where it is text node or element node.
To get the DOM Node you can use [0]
:
var mm = $(".jj")[0];
if (mm.nodeType === 1) {
// Node.ELEMENT_NODE
}
However, Text node is the first child of your nodeValue
.
alert(mm[0].firstChild.nodeValue);