Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Hintergrundfarbe column

Empfohlene Antworten

Veröffentlicht

Hallöchen,

ich habe hier ein kleines Problem.

Ich stelle eine Site dar, die einen table enthält.

Um es ganz einfach zu sagen, ich möchte mir nur die Farbe einer Zelle im alert ausgeben lassen.

Das klappt auch mit "alert("Farbe: " +event.srcElement.bgColor);

Nun ist es aber so, dass ich bei einer bestimmten Aktion, die Farbe einer Spalte ändere mit :

"<col style='background-color:#FFFF99'>"

Klicke ich nun auf das Element, wird im alert immer noch die gleiche Frabe ausgegeben.

Wie kann ich mir die geänderte Frabe der column ausgeben lassen.

Bis dann

André

Es ist ein unterschied, ob du einen HTML-Parameter ansprichst oder durch css ein background-color setzt. Im Zweifelsfalle würde ich behaupten, dass die CSS-Einstellung die HTML-Einstellung überschreibt, zumindext bei Browsern != Netscape 4.x

du müsstes also nicht srcElement.bgcolor, sondern srcElement.style.backgroundColor behandeln.

geht das überhaupt? hmmmm - interessante sache.

Grüße

Matze

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.