
Extends the Elements object to add a function that returns a collection of elements from a string of html.
Returns a collection of elements from a string of html.
Elements.from(str, excludeScripts);
var els = Elements.from("<p>this is a <i>string</i> of <b>HTML</b>.</p><p>It has two paragraphs.</p>"); els.each(function(paragraph){ console.log(paragraph); //logs each paragraph }); els.inject(document.body); //injects both paragraphs into the document body
© Linux.ria.ua, 2008-2024 |