2014-10-03 12 views

cevap

5

Merhaba.

jQuery("#myInputTags") 
    .textext({ 
     plugins: 'tags, prompt', 
     prompt: 'add tag' 
    }) 
    .keypress(function(event){ 
    //'Space' key is pressed in keyboard 
    if(event.which==32){ 
     addTag(); 
    } 
    }); 

jQuery("#btnId").click(function(){ 
    addTag(); 
}) 

function addTag(){ 
    //Take the value from text input 
    var tag = $('#myInputTags').val(); 

    //Clear the text input and add tag 
    $('#myInputTags').val('').textext()[0] 
    .tags().addTags([tag]); 
} 

See a Live Demo of this

Dokümanlar:TexExt - Adding Tags Directly

İlgili konular