added a hasAttr jquery function