Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/javve/get-attribute
A cross-browser implementation of getAttribute
https://github.com/javve/get-attribute
Last synced: about 1 month ago
JSON representation
A cross-browser implementation of getAttribute
- Host: GitHub
- URL: https://github.com/javve/get-attribute
- Owner: javve
- Created: 2012-12-13T20:53:23.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2012-12-29T10:24:57.000Z (almost 12 years ago)
- Last Synced: 2024-04-14T09:10:10.814Z (7 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
![web component logo](http://i49.tinypic.com/e7nj9v.png)
# getAttribute
A cross-browser implementation of getAttribute.
Source found here: [http://stackoverflow.com/a/3755343/361337](http://stackoverflow.com/a/3755343/361337)
written by [Vivin Paliath](http://stackoverflow.com/users/263004/vivin-paliath)Uses default `getAttribute` if it's available.
## Component
Built to be used with the [Component package manager](https://github.com/component/component). Read more here:
* [Component at Github](https://github.com/component/component)
* [TJ Holowaychuk's introduction](http://tjholowaychuk.com/post/27984551477/components)## Installation
$ component install javve/get-attribute
## Example
```html
``````js
var getAttribute = require('get-attribute');var el = document.getElementById('test')
var dataValue = getAttribute(el, 'data-value');alert(dataValue); // Alerts "myValue"
```## API
### getAttribute(element, attribute)
Return the value for `attribute` at `element`.
## License
MIT