Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Check if html th is on focus
#2
Hi opti13403,
this Forum is a German Forum. Please write in German in the future in this forum. I have a suitable solution for your problem. I hope it helps you.

Code:
'use strict';
document.addEventListener('DOMContentLoaded', init);
var elem, isfocus;
function init() {
    isfocus = false;
    elem = elem = document.getElementById("myID");
    elem.addEventListener('focus', function() {
        isfocus = true;
    });
    elem.addEventListener('blur', function() {
        isfocus = false;
    });
}

In this case i use two different event-handler. One to trigger on an focus-event and one for the blur-event. Your code is buggy and it is not written in the HTML or in the HTML5-Standard. TH as element stands for tablehead and is an part of a table.
Code:
p-sortIcon
This is not an element in HTML or HTML5. The p-element stands for paragraph.
Zitat:<p class="sortIcon" data-field="column.field" data-ngIf="column.sortable"></p>


bw rzscout

"Gerne dürft ihr mir eine gute Bewertung da lassen aber auch gegenüber Kritik bin ich offen" Angel
Zitieren


Nachrichten in diesem Thema
Check if html th is on focus - von opti13403 - 27.09.2022, 09:14
RE: Check if html th is on focus - von rzscout - 28.09.2022, 09:40

Gehe zu:


Benutzer, die gerade dieses Thema anschauen:
2 Gast/Gäste