I am running discourse and I am trying to modify what happens when one clicks the logout link, I do not want to modify discourse stock javascript...
- There is an element
elem1
that when clicked inserts another html menu with the logout link. So is it not present when$(document).ready..
is called. I need to modify what happens onelem2
.click which is where the logout link is.
I want to do this...
$("#elem1").click(function() {
console.log("step1")
$("#elem2").click(function () {
console.log("step2")
..do my custom logout
})
})
but I think jquery is not finding it because it was not there when it first loaded.