Change out hasAttribute for getAttribute for better backward support