I’d like to see if there is a way to remove all the surplus html apart from the element (and it’s content) that comes with a typical optin form embed code (Mailchimp, Aweber, ect)
My goal is to have a user paste in the code as provided by the supplier into a textarea and then have it sanitized by clicking a button so they’re just left with the element and it’s content.
Here’s is a pen of what I have so far. I have no idea of how close/far away I am from any success (or indeed if this is possible at all)
Any help is, as ever, very much appreciated :)
Thanks
Richard
$( '#tidy' ).click(function() {
var formContent = jQuery('textarea').val();
$(formContent).not('form').remove();
alert(formContent);
});