>
>
To escape content in attributes, use esc_attr() instead of esc_html(). But for the titles inside attributes, use the following, which is already echoed and escaped for us: https://developer.wordpress.org/reference/functions/the_title_attribute/