This repository was archived by the owner on Sep 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -212,5 +212,36 @@ <h2 id="onadd-ondelete">Using onAdd and onDelete Callbacks</h2>
212
212
} ) ;
213
213
</ script >
214
214
</ div >
215
+
216
+
217
+ < h2 id ="plugin-methods "> Using the add, remove and clear Methods</ h2 >
218
+ < div >
219
+ < a href ="# " id ="plugin-methods-add "> Add Token</ a > | < a href ="# " id ="plugin-methods-remove "> Remove Token</ a > | < a href ="# " id ="plugin-methods-clear "> Clear Tokens</ a > < br />
220
+ < input type ="text " id ="demo-input-plugin-methods " name ="blah " />
221
+ < input type ="button " value ="Submit " />
222
+ < script type ="text/javascript ">
223
+ $ ( document ) . ready ( function ( ) {
224
+ $ ( "#demo-input-plugin-methods" ) . tokenInput ( "http://shell.loopj.com/tokeninput/tvshows.php" ) ;
225
+
226
+ // Add a token programatically
227
+ $ ( "#plugin-methods-add" ) . click ( function ( ) {
228
+ $ ( "#demo-input-plugin-methods" ) . tokenInput ( "add" , { id : 999 , name : "James was here" } ) ;
229
+ return false ;
230
+ } ) ;
231
+
232
+ // Remove a token programatically
233
+ $ ( "#plugin-methods-remove" ) . click ( function ( ) {
234
+ $ ( "#demo-input-plugin-methods" ) . tokenInput ( "remove" , { name : "James was here" } ) ;
235
+ return false ;
236
+ } ) ;
237
+
238
+ // Clear all tokens
239
+ $ ( "#plugin-methods-clear" ) . click ( function ( ) {
240
+ $ ( "#demo-input-plugin-methods" ) . tokenInput ( "clear" ) ;
241
+ return false ;
242
+ } ) ;
243
+ } ) ;
244
+ </ script >
245
+ </ div >
215
246
</ body >
216
247
</ html >
You can’t perform that action at this time.
0 commit comments