質問

Currently I am using tag-it to my work. I have create tagbox & i can write on tag by using : https://github.com/aehlke/tag-it. But I need to know the value of each tag in that tagbox. How can I get this ? Please suggest me.

Html code :

<ul id="myTags" ></ul>
<input type="hidden" id="tag" style="width:400px;height:40px;" value=""  placeholder="Add tags" />

Jquery code :

$("#myTags").tagit();
役に立ちましたか?

解決

Use the assignedTags method

var tags = $("#myTags").tagit("assignedTags");

See this fiddle for an example.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top