How can I change the method's behavior based on which node was clicked? I want to change the data
attribute's value
to 0
if the $('.parent')
was clicked.
$('.parent').on('click', function (event) {
this.someClickFunction(event);
});
$('.child').on('click', function (event) {
this.someClickFunction(event);
});
someClickFunction: function (event) {
//TODO: If $('.parent') was clicked, change to 0
$('.holder').data('type', 1);
}