Skip to main content

You can try below

<lightning:button variant="brand" label="Charge" data-value="{!s.Id}" onclick="{!c.callMyCallback}" />

callMyCallback : function(cmp, event, helper) {

var value = event.target.dataset.value;

<lightning:button variant="brand" label="Charge" **data-value**="{!s.Id}" onclick="{!c.callMyCallback}" />

}

callMyCallback : function(cmp, event, helper) {
    var value = **event.target.dataset.value**;
}

You can try below

<lightning:button variant="brand" label="Charge" data-value="{!s.Id}" onclick="{!c.callMyCallback}" />

callMyCallback : function(cmp, event, helper) {

var value = event.target.dataset.value;

}

You can try below:

<lightning:button variant="brand" label="Charge" **data-value**="{!s.Id}" onclick="{!c.callMyCallback}" />
callMyCallback : function(cmp, event, helper) {
    var value = **event.target.dataset.value**;
}
Source Link

You can try below

<lightning:button variant="brand" label="Charge" data-value="{!s.Id}" onclick="{!c.callMyCallback}" />

callMyCallback : function(cmp, event, helper) {

var value = event.target.dataset.value;

}