I've made this function where what I want to have happen is that when the document registers a click event, I want the text of that event's html element to be logged to the console only if the text is "Reply". This is the code I've got at this point.
function clickEventText() {
$(document).click(function (event) {
var eventText = $(event.target).text();
var replyText = "Reply";
if (eventText = replyText ) {
console.log(eventText);
}
});
};
The problem I'm having is that regardless of the event.target's text the console logs the string "Reply" every time the document registers a click event.