We have a piece of html that we are using to create an object that we pass into a function that clones data.
We are trying to get that cloned data and replace a common id with a new id that has been dynamically set elsewhere. below is what we have got:
// This is the cloned data we have got
var data = this.$container.find('.fields').clone();
// This is the id we are getting to find in the cloned html above
var id = this.$container.data('id');
// This is where we need to go through all html and replace the id above in here with whatever we need
var replacedHtml = data.innerHtml().replace(id,'test');
// the cloneVariant function takes the data and does some good stuff with it. The $.parseHTML(replacedHtml) takes the string html and makes the dom element that goes into the coneVariant function.
this.matrix.cloneVariant(this.$container,$.parseHTML(t));
What I need to do is replace that found id in the html with a string.
Can this be done?