Use jQuery to replace text in a html document at runtime.
The following example replaces the WooCommerce Product Titles with the same title wrapped in H3 tags.
<script>
jQuery(document).ready(function() {
jQuery(".woocommerce-loop-product__title").replaceWith(function() {
return '<h3>' + jQuery(this).text() + '</h3>';
});
});
</script>Code language: HTML, XML (xml)