[SOLVED] Need help with chip


#1

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!

Thanks,
Vakhtang


#2

Change

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

to

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

#3

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


#4

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.


#5

Something like:

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