`hasAttribute` -> `getAttribute` to fix IE8 issue.