Q:

data-item-id

// Get the valuesvar cmd = $('#your-button-id').attr('data-cmd');var id = $('#your-button-id').attr('data-id'); // Change the values$('#your-button-id')    .attr('data-cmd', yourNewCmd)    .attr('data-id', yourNewId);
0
// Here's our buttonvar button = document.getElementById('your-button-id'); // Get the valuesvar cmd = button.getAttribute('data-cmd');var id = button.getAttribute('data-id'); // Change the valuesbutton.setAttribute('data-cmd', yourNewCmd);button.setAttribute('data-id', yourNewId);
0

New to Communities?

Join the community