Since you are sending the target element to your function, you could do this to get the id:
function doStuff(item){
var id = item.attributes['data-id'].value; // 345
}
Since you are sending the target element to your function, you could do this to get the id:
function doStuff(item){
var id = item.attributes['data-id'].value; // 345
}