How do I remove all tags in an input field below with jQuery?

chiz picture chiz · Mar 18, 2017 · Viewed 11.3k times · Source

How do I remove all tags in an input field below with jQuery?

<input class="form-control" id="videotags" data-role="tagsinput"  placeholder="Video Tags" type="text">

  //what I tried:
<script>$("#videotags").remove();</script>

Answer

Raghavendra N picture Raghavendra N · Jun 1, 2017

If you are using Bootstrap tagsinput try this:

$("#videotags").tagsinput('removeAll');

source