Source code

Revision control

Copy as Markdown

Other Tools

<html>
<head>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<title>Testing Clicks</title>
<script>
function addMousedownListener() {
let el = document.getElementById('showbutton');
el.addEventListener('mousedown', function (evt) {
evt.target.innerText = evt.button;
});
}
</script>
</head>
<body>
<h1>Testing Clicks</h1>
<div>
<p id="links">Links:</p>
<ul>
<li><a href="test.html">333333</a>
<li><a href="test.html" id="normal">Normal</a>
<li><a href="#" id="anchor">I go to an anchor</a>
<li><a href="addons/webextension-unsigned.xpi" id="install-addon">Install Add-on</a>
</ul>
</div>
<div>
<p id="js-links">Javascript links:</p>
<ul>
<li>Navigate in history:
<a href="javascript:history.back();" id="history-back">Back</a>
<a href="javascript:history.forward();" id="history-forward">Forward</a>
<li><a href="javascript:window.open('test.html', '_blank')" id="new-window">Open a window</a>
<li><a href="javascript:window.close();" id="close-window">Close tab/window</a>
<li><a id="addbuttonlistener" href="javascript:addMousedownListener();">Click</a> to
add an event listener for: <span style="color: red;" id="showbutton">button click</span>
</ul>
</div>
<div>
<p id="special">Special:</p>
<select id="option" onclick="window.location = '/slow?delay=1'">
<option>Click to navigate</option>
</select>
<p style="background-color: rgb(0, 255, 0); width: 5em;">
<a id="overflowLink" href="test.html">looooooooooong short looooooooooong</a>
</p>
</div>
</body>
</html>