[SOLVED] Need help with chip

Hi, friends

Need your help again. I use Chips in this example http://mykeep.ru/index_new.php
If chip div put in static page - chip-delete functional working properly. But if I dynamically add new chips by click (via getElByID.innerHTML) - chips-deleting not working and also for static chip.

Please help!



$$('.chip-delete').on('click', function (e) {


$$(document).on('click', '.chip-delete', function (e) {

Many, many thanks!!! All working! :smile:

One more question, please.

How to get name of deleted chip? I mean Chip-label? In parallel I will save chips on array: after adding push (its simple) and after delete I need to remove element from array.

Something like:

$$(document).on('click', '.chip-delete', function (e) {
  var label = $(this).prev('.chip-label').text();