JQUERY 28
JS create an array and alert objects By micha on 25th October 2018 03:28:32 PM
  1. $('.item-select').click(function() {
  2.     let uid    = $(this).attr('id'),
  3.         title  = $(this).children('.title').text(),
  4.         price  = $(this).children('.price').text(),
  5.         parent = $(this).data('parent');
  6.         schedule_t    = $(this).next('.schedule-wrapper').children('h5').text(),
  7.         schedule_v    = $('#T' + uid + ' option:selected').text(),
  8.         schedule_arr  = {'id' : uid, 'title' : schedule_t, 'value' : schedule_v},
  9.  
  10.         alert(JSON.stringify(schedule_arr));
  11.  
  12.         ...
  13. });

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.