clicks.html (1772B)
1 <html> 2 <head> 3 <!-- This Source Code Form is subject to the terms of the Mozilla Public 4 - License, v. 2.0. If a copy of the MPL was not distributed with this 5 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 6 <title>Testing Clicks</title> 7 8 <script> 9 function addMousedownListener() { 10 let el = document.getElementById('showbutton'); 11 12 el.addEventListener('mousedown', function (evt) { 13 evt.target.innerText = evt.button; 14 }); 15 } 16 </script> 17 </head> 18 19 <body> 20 <h1>Testing Clicks</h1> 21 22 <div> 23 <p id="links">Links:</p> 24 <ul> 25 <li><a href="test.html">333333</a> 26 <li><a href="test.html" id="normal">Normal</a> 27 <li><a href="#" id="anchor">I go to an anchor</a> 28 <li><a href="addons/webextension-unsigned.xpi" id="install-addon">Install Add-on</a> 29 </ul> 30 </div> 31 32 <div> 33 <p id="js-links">Javascript links:</p> 34 <ul> 35 <li>Navigate in history: 36 <a href="javascript:history.back();" id="history-back">Back</a> 37 <a href="javascript:history.forward();" id="history-forward">Forward</a> 38 <li><a href="javascript:window.open('test.html', '_blank')" id="new-window">Open a window</a> 39 <li><a href="javascript:window.close();" id="close-window">Close tab/window</a> 40 <li><a id="addbuttonlistener" href="javascript:addMousedownListener();">Click</a> to 41 add an event listener for: <span style="color: red;" id="showbutton">button click</span> 42 </ul> 43 </div> 44 45 <div> 46 <p id="special">Special:</p> 47 <select id="option" onclick="window.location = '/slow?delay=1'"> 48 <option>Click to navigate</option> 49 </select> 50 51 <p style="background-color: rgb(0, 255, 0); width: 5em;"> 52 <a id="overflowLink" href="test.html">looooooooooong short looooooooooong</a> 53 </p> 54 </div> 55 56 </body> 57 </html>