Important I'm not trying to scam/phish or in any way harm anyone. I'm creating a magnifier for websites to use much like you would use a magnifier on a piece of paper.
Problem
I'll set the scenario.
I've essentially duplicated an entire webpage's HTML, then laid the duplication over the original page. Like so:
When I click an element on the duplicated HTML, i'd like the click event to be passed on to the original page.
This was how I was approaching the problem:
duplicate_element.onmousedown = function(event) {
var range = document.createRange();
var test = range.setStart(event.target, 0);
// Then I hoped to use:
range.startContainer
// to search for the clicked element on the original content
document.find(range.startContainer)
}
So i'm stumped on how to find the matching element from the clicked target in the original HTML.
There are a few rules to the puzzle:
- I can't use a library
- But, I do have access to jQuery's sizzle
- Pointer Events - I want to be able to interact with the duplicated HTML, but actually affect the original HTML. I think Pointer events makes the duplicated version untouchable
Any help would be great. I'll answer any questions you need. Thanks :)