我正在开发一个根据所选国家/地区获取工作的职位列表元素,现在我正在尝试创建一个搜索框,将我的文本更改为标签,就像 StackOverflow 添加标签的方式一样。我已经有了 figma 设计,但实现是个问题。
这是 figma 链接:https://www.figma.com/proto/UE9D4alg1970WXIDnLAfVzHz/listing-by-country?node-id=96%3A0&scaling=min-zoom
<div class="input-group input-group-search">
<input id="search-text" value="" type="search" class="form-control" placeholder="Enter Job listing according to Countries">
<div class="input-group-btn">
<button class="btn btn-primary ml-2" id="search-submit" type="submit">Search</button>
</div>
</div>
我希望结果在搜索框之后或搜索框内立即生成标签。提前致谢
最佳答案
你可以使用像这样的东西:https://github.com/yairEO/tagify
甚至:
https://selectize.github.io/selectize.js/
Google 是您的 friend 。
关于javascript - 如何在搜索框中为文本添加标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55912458/