0

I have this strange requirement where I need to store multiple ids in a list. Can we append multiple ids like this one id="'+ y.home +'", id="'+ y.away +'", id="'+ y.draw +'" .... on...

<input type="text" id="home_score">
<ul id="cholder"></ul>
$.each(data, function(tx,ty) {
  $("ul#cholder").append('<li id="'+ y.home +'"> ' + y.event + '</li>');
    $('ul#cholder').on('click', 'li', function() {
      $('#home_score').val(this.home);
    });
  });
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339