Consider the following:
On my iPhone I couldn't get a click event to fire on this anchor until I added
to the anchor. The anchor was added to the DOM after the page load. I'm able to recreate this by using JS to add an anchor to the DOM and confirmed it doesn't register the click, but if I added it on page load it does.
I have a few questions:
- Why does the href need to be there for the click event to fire.
- Is there another method to get the event to register? (I was thinking something to do with tab index or something like that.)
- Is this specific to OS/Device/Browser/Platform or is this something working as it should per W3C documentation?
the same as
. I came across the
thing while researching this and I've always just done
Answer to 1,2 & 3 apparently because the
in turn adds the CSS styling of
it makes it magically work. I don't have an android device to test.
Answer to #4 is apparently, it's 2016. Not sure what that means.