KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How do I intercept link clicks in document? It must be cross-platform. I am looking for something like this: // content is a div with innerHTML var content = document.getElementById("ControlPanelContent"); content.addEventListener("click", ContentClick, false); function ContentClick(event) { if(event.href == "http://oldurl") { event.href = "http://newurl"; } }
Tags (comma-separated)
Save Edits
Cancel