浏览代码

Update readme

Robin Herbots 13 年之前
父节点
当前提交
811c011449
共有 1 个文件被更改,包括 15 次插入0 次删除
  1. 15 0
      README.md

+ 15 - 0
README.md

@@ -17,6 +17,7 @@ Highlights:
 - non-greedy masks
 - non-greedy masks
 - many features can be enabled/disabled/configured by options
 - many features can be enabled/disabled/configured by options
 - supports readonly/disabled/dir="rtl" attributes
 - supports readonly/disabled/dir="rtl" attributes
+- support data-inputmask attribute
 
 
 ## Usage:
 ## Usage:
 
 
@@ -322,6 +323,20 @@ $(document).ready(function(){
 ```html
 ```html
 <input id="test" maxlength="4" />
 <input id="test" maxlength="4" />
 ```
 ```
+### data-inputmask attribute
+
+You also apply an inputmask by using the data-inputmask attribute.  In the attribute you specify the options wanted for the inputmask.
+This gets parsed with $.parseJSON (for the moment), so be sure to use a welformed json-string without the {}.
+
+```html
+<input data-inputmask="'alias': 'date'" />
+<input data-inputmask="'mask': '9', 'repeat': '10', 'greedy' : 'false'" />
+```
+```javascript
+$(document).ready(function(){
+    $(":input").inputmask();
+});
+```
 
 
 ## Compiling with Google Closure Compiler
 ## Compiling with Google Closure Compiler