项目作者: jvyyuie

项目描述 :
Disable button when input is empty
高级语言: JavaScript
项目地址: git://github.com/jvyyuie/snbutton.git
创建时间: 2017-08-07T14:43:15Z
项目社区:https://github.com/jvyyuie/snbutton

开源协议:MIT License

下载


snbutton

A tiny jQuery plugin that could control the button’s state

It is a very simple jquery plugin that disables button when some input filed is empty.

Usage

Step.1 Download

  • Using bower to install it. bower install snbutton

  • Download from github.

Step.2 Load Script

Load the script file: snbutton.js in your application:

  1. <script type="text/javascript" src="bower_components/snbutton/snbutton.js"></script>

Step.3 Code

  1. <input id="input-700" />
  2. <button id="submit-button" data-snnode="input-700">Submit</button>
  3. <script>
  4. SNButton.init("submit-button");
  5. </script>