Skip to content

Instantly share code, notes, and snippets.

@miketaylr
Created January 12, 2011 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miketaylr/776501 to your computer and use it in GitHub Desktop.
Save miketaylr/776501 to your computer and use it in GitHub Desktop.
DOM element logging test
var elm = document.createElement('input')
elm.className = "testClass";
elm.id = "testID";
elm.setAttribute('data-rofl', 'copter') //elm['data-rofl'] = "copter"; doesn't work in webkit/firebug
elm.type = "search";
elm.setAttribute('list', "testDatalist") // elm.list = "foo"; doesn't work in webkit/firebug
console.log(elm);
console.log(elm.outerHTML);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment