简体   繁体   English

jQuery和格式化文本区域以进行标记?

[英]Jquery and formating a textarea for tagging?

I am looking for a way to use a textarea and get the values separated by commas, and place them into the array. 我正在寻找一种使用textarea并用逗号分隔值并将它们放入数组的方法。

Really I am looking for how to auto format the textarea so when the user types something in it either forces or something a comma break. 的确,我在寻找如何自动设置文本区域格式的方法,以便当用户在其中键入内容时强制或逗号中断。 I want to use autocomplete, but I have no data to check it with since this will be a new user sign up. 我想使用自动完成功能,但是我没有数据可以检查,因为这将是新用户注册。

What's the best approach? 最好的方法是什么?

var text = $('#mytextarea').val().split(" ");

您可以使用此插件来强制文本区域中的项目分离

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM