I have a function:
function Check(o)
{
alert(/* o is a DOM element ? "true" : "false" */);
}
How can I check if the parameter o
is a DOM element or not?
A DOM element implements the Element
interface. So you can use:
function Check(o) {
alert(o instanceof Element);
}