I need to remove http:// which is in an existing code.
I tried the following jQuery, but both codes don’t remove http://.
Would you please let me know how to remove it?
jQuery I tried:
jQuery(".elementor-button-wrapper").find("http://").each(function(){
var linkText = $(this).text();
$(this).remove();
});
jQuery('.elementor-button-wrapper a [href="http://]').each(function() { this.setAttribute('href', ''); });
Existing code:
<div class="elementor-button-wrapper">
<a href="http://https://www.myweb.com/hereis" class="elementor-button-link elementor-button elementor-size-sm" role="button">
<span class="elementor-button-text">Read More</span>
</a>
</div>
Thank you.
2
Answers
The following script should get the current value of the href attribute of the link element inside the elementor-button-wrapper div, remove the http:// string or replace it with blank, then apply the newlink back to the link’s href attribute.
You could try this.