Benutzer:Totto/common.js: Unterschied zwischen den Versionen

Zur Navigation springen Zur Suche springen
K
Irrelevant?!?
K (Wtf ??)
K (Irrelevant?!?)
Zeile 47:
}
 
function addHotkeyF(hotkey,function_to_call){ var num= hotkey.toUpperCase().charCodeAt(0); document.addEventListener("keydown", event => { const key = event.keyCode; if(key==num){ function_to_call(); } } );
var num= hotkey.toUpperCase().charCodeAt(0);
 
document.addEventListener("keydown", event => { const key = event.keyCode; if(key==num){ function_to_call(); } } );
}
 
 
function getAllElementsWithAttribute(attribute){
{
var matchingElements = [];
var allElements = document.getElementsByTagName('*');
for (var i = 0, n = allElements.length; i < n; i++){
if (allElements[i].getAttribute(attribute) !== null) {
{
if (allElements[i].getAttribute(attribute) !== null)
{
// Element exists with attribute. Add to array.
matchingElements.push(allElements[i]);
1.060

Bearbeitungen

Navigationsmenü