Guys this is a broad question, but I’ll try to keep it simple.
Simply what I want to do is, look for a particular onClick, example addToCart('57'), and find replace the Value attribute of that particular input box containing addToCart('57') to Added.
I got the onclick event string using
var getOnClickValueForNotification = $('.cart input').attr("onclick");
But Im finding it hard to implement jquery find to look for getOnClickValueForNotification and replace Value attribute to Added.
You need to be using the .on(‘click’) event for the input (note, that there may already be an event attached to this input, so you will need to find and use that if so) and pass the event handler through to find the target of what was clicked.
Something like this should do the job.