Skip to content

Instantly share code, notes, and snippets.

@jnf
Created August 7, 2009 02:45
Show Gist options
  • Save jnf/163684 to your computer and use it in GitHub Desktop.
Save jnf/163684 to your computer and use it in GitHub Desktop.
//sometimes, you just want the copy inside an element.
function $T(element) {
var t = $(element);
return t == null ? t : t.innerHTML.gsub(/<\/?[^>]*>/, '');
}
//is fetching the innerHTML bad form? Most of the time, yeah.
function $M(element) {
var m = $(element);
return m == null ? m : m.innerHTML;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment