Skip to content

javve/get-attribute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web component logo

getAttribute

A cross-browser implementation of getAttribute.

Source found here: http://stackoverflow.com/a/3755343/361337 written by Vivin Paliath

Uses default getAttribute if it's available.

Component

Built to be used with the Component package manager. Read more here:

Installation

$ component install javve/get-attribute

Example

<div id="test" data-value="myValue"></div>
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

About

A cross-browser implementation of getAttribute

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published