I'm still learning of how to use jQuery but I stumbled with a block and can't get through it. How to append an option to a select with data-* attribute? Currently I'm appending option through this code below:
$('<option>').val(object.val).text(object.object.text).appendTo('#includedItems');
Is there a way to also add data-* to the options?
.attr('data-something','somevalue')to add data-* attribute. That's said, depending your use case, you could instead use the data object.data('something','somevalue')which won't update the DOM attribute