JqueryのjQuery-Tags-Inputのコードリーディング
jQuery-Tags-Input/jquery.tagsinput.js at master · xoxco/jQuery-Tags-Input
xoxco.com/projects/code/tagsinput/example.html
使い方
$("#tag").tagInput()
上の様に使える。
コードの中身
疑似的なDOMを作っており、そいつらが描画を変更したり、fake_inputをしたりしている。
var data = jQuery.extend({ pid:id, real_input: '#'+id, holder: '#'+id+'_tagsinput', input_wrapper: '#'+id+'_addTag', fake_input: '#'+id+'_tag' },settings);
pidは元々のinputタグ、real_inputはpidと同じ。 holderはwrapper的な奴。 fake_inputはholderの中にある仮のinputタグ