Replaced static HTML error messages and icons with dynamically added elements