I am working on a program that investigates the DOM object, mostly as a learning process for myself.

My program displays characteristics of an element that it finds, but in the DOM, the attributes ie 'Name' are not consistent for all types of elements (Tags).

Is there a test to check for the presence of a given property, method etc that I can make beforehand to avoid generating errors when I try to retrieve the data in a generalized routine?

It seems there would be a method that would apply to objects in general.

Thanks in advance.