check if element has a certain attribute code example Example: how to check element has an attribute js let result = element.hasAttribute(name);