refactor element with value to use attribute string method