Get Invalid Html Code In Curly Brackets With Jquery
Solution 1:
So, basically you want to get the 'outer' html and then search for whats in between the curly braces.
The first part of that has been solved here
Get selected element's outer HTML
So using the outerHTML plugin from that question
jQuery.fn.outerHTML = function(s) {
return s
? this.before(s).remove()
: jQuery("<div>").append(this.eq(0).clone()).html();
};
functionsomeFunction(id) {
return $('#text'+id).outerHTML().match(/{(.*)}/)[1];
}
Post a Comment for "Get Invalid Html Code In Curly Brackets With Jquery"