jquery-attrs

1.0.0 • Public • Published

$.fn.attrs()

Retrieves all the attributes with their associated values as object.

Example

<div id="elem" data-one="hello" data-two="world" something="else"></div>
$("#elem").attrs()
// -> { 'data-one': "hello", 'data-two': "world", 'something': "else" }
 
$("#elem").attrs(/^data\-/)
// -> { 'data-one': "hello", 'data-two': "world" }

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    2
  • 0.1.0
    0

Package Sidebar

Install

npm i jquery-attrs

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • scravy