mdbootstrap / bootstrap-templates

A collection of free Bootstrap 5 templates.
https://mdbootstrap.com/freebies/
3.07k stars 1.01k forks source link

How to return text of clicked tag #657

Closed Mashiane closed 2 years ago

Mashiane commented 5 years ago

How can I get the text of a clicked tag element?

pablocorezzola commented 5 years ago

Try

$(document).on('click', '.bootstrap-tagsinput > .tag', function(){ console.log($(this).text()); })