Skip to content

Instantly share code, notes, and snippets.

@ju1ius
Created December 26, 2010 19:15
Show Gist options
  • Save ju1ius/755576 to your computer and use it in GitHub Desktop.
Save ju1ius/755576 to your computer and use it in GitHub Desktop.
var abbr = 'ul>li*3>h2+p*2';
try
{
// expands abbreviation and inject results into 'my-element'
$('my-element').expandAbbreviation(abbr);
// returns an Elements object
var elements = ZenCoding.abbrToElements(abbr);
// expands abbreviation to an html string
var my_string = String.expandAbbreviation(abbr);
}
catch(e)
{
// throw an error if abbreviation is invalid
console.log(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment