use hasAttribute instead of getAttribute to test for an attribute
definition.