is-button

1.0.0 • Public • Published

is-button

Check if an element is a button (<button> or input[type="button"])

Supported in IE8+.

Install

$ npm install --save is-button

Usage

var isButton = require('is-button');
 
isButton(document.querySelector('#el')); // <button id="el">Button</button>
//=> true
 
isButton(document.querySelector('#el')); // <input type="button" id="el">
//=> true
 
isButton(document.querySelector('#el')); // <strong id="el">Not a button</strong>
//=> false
 
isButton(document.querySelector('#el')); // <input type="submit" id="el">
//=> false

License

MIT © Arthur Verschaeve

Package Sidebar

Install

npm i is-button

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • arthurvr