jQuery生成标签插件

jQuery生成标签插件398
这是一个jQuery插件,帮助输入表单添加标签。
头部分添加以下:
 <link rel="stylesheet" href="css/jquery.tagbox.css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.tagbox.js"></script>
    <script type="text/javascript">
        jQuery(function () {
            jQuery("#jquery-tagbox-text").tagBox();
            jQuery("#jquery-tagbox-select").tagBox({
                enableDropdown: true,
                dropdownSource: function () {
                    return jQuery("#jquery-tagbox-select-options");
                }
            });
        });
    </script>
添加您的表单元素如下:
<form action=".">
<div class="row">
      <label for="jquery-tagbox-text">Text TagBox (Comma Separated)</label>
      <input id="jquery-tagbox-text" type="text" />
</div><!--div.row-->
<div class="row">
      <label for="jquery-tagbox-select">Dropdown TagBox</label>
      <select id="jquery-tagbox-select-options">
        <option value="jQuery">jQuery</option>
        <option value="MooTools">MooTools</option>
        <option value="ProtoType">ProtoType</option>
        <option value="Scriptaculous">Scriptaculous</option>
        <option value="Dojo">Dojo</option>
      </select><!--select#-->
      <input id="jquery-tagbox-select" type="text" />
</div><!--div.row-->
</form>

也许你还喜欢