How to use js and css to realize the label input effect of segmentfault?

  node.js, question

图片描述

As shown in the figure, I want to make a tag input widget similar to this one. Some of the following features do not know how to achieve better, ask for advice from experienced people.

  1. Enter commas or semicolons and automatically switch to the label effect above.

  2. Press the cancel key after the label to delete the label.

  3. Limit the maximum number of labels to x.

There are also some advanced features:

  1. Enter the label and automatically prompt for completion.

  2. Bring your own tips.

What may be described is not very clear, and the specific features can open up an actual experience of a problem publishing page.

I’ll finish my meal later and finish it. I’ve just rolled up a bit.Demo address