Methods for retrieving element attributes

Examined element (original markup)

<p id="foo" class="bar" lang="en" type="text/x-template" hidden contenteditable=""></p>

Examined element, as interpreted by the browser (element.outerHTML)

<p id="foo" class="bar" lang="en" type="text/x-template" hidden="" contenteditable=""></p>

Attributes detected with vanilla JS

id: foo
class: bar
lang: en
type: text/x-template
hidden:
contenteditable:

Attributes detected with vanilla JS (Array.reduce)

id: foo
class: bar
lang: en
type: text/x-template
hidden:
contenteditable:

Attributes detected with jQuery

id: foo
class: bar
lang: en
type: text/x-template
hidden:
contenteditable:

Attributes detected with Underscore

id: foo
class: bar
lang: en
type: text/x-template
hidden:
contenteditable:

Attributes detected with lodash

id: foo
class: bar
lang: en
type: text/x-template
hidden:
contenteditable:

Edit in JS Bin