Javascript String CreateElementFromHtml()

Description

Javascript String CreateElementFromHtml()

String.prototype.CreateElementFromHtml = function () {
    var d = "div".CreateElement({ innerHTML: this }), dcs = d.children;
    while (dcs.length > 0) {
        var c = dcs[dcs.length - 1];
        return c;
    }//from  w ww .j ava 2  s  .c  o  m
};



PreviousNext

Related