<!DOCTYPE html><html><head><metacharset="utf-8"><title>href click</title><linkrel="help"href="https://w3c.github.io/mathml-core/#attributes-common-to-html-and-mathml-elements"><linkrel="help"href="https://w3c.github.io/mathml-core/#dom-and-javascript"><scriptsrc="/resources/testharness.js"></script><scriptsrc="/resources/testharnessreport.js"></script><scriptsrc="/resources/testdriver.js"></script><scriptsrc="/resources/testdriver-vendor.js"></script></head><body><p>To test manually, click the blue rectangle.</p><p><math><mspacewidth="50px"height="10px"style="background: gray"></mspace><mspaceid="target"href="javascript:handler()"width="50px"height="10px"style="background: blue"></mspace><mspacewidth="50px"height="10px"style="background: gray"></mspace></math></p><aid="badTarget"href="javascript:badHandler()">DON'T CLICK ME</a><script>vart=async_test("Click element with href");functionhandler(){t.done();}functionbadHandler(){t.step(()=>{assert_unreached("Bad handler executed");});t.done();}test_driver.click(document.getElementById("target")).then(()=>{returntest_driver.click(document.getElementById("badTarget"));}).catch(()=>{t.step(()=>{assert_unreached("Click failed");});t.done();});</script></body></html>