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.

Empfohlene Antworten

Veröffentlicht

hi...

hab nich so richtig ahnung von javascript!

brauche ein kleines script das erkennt, wann die checkbox selected ist, wenn ja dann soll sie die farbe davon ändern!

wäre nett wenn einer helfen könnte...

Welche Farbe soll geändert werden? Das der Checkbox? Geht glaube ich garnicht, da Checkboxen doch vom System gerendert werden. Oder irre ich?

man kann mittels css den hintergrund einer checkbox ändern! jetzt habe ich ihn ja auf weiss, und wenn sie selected ist soll er rot werden!

Ungefähr so?


<html>
<body>

<script language="javascript">
function setzen()
{
if (document.getElementById("box").checked == true)
{
document.getElementById("box").style.backgroundColor="#ff0000";
}
else
{
document.getElementById("box").style.backgroundColor="#ffffff";
}
}
</script>

<input type="checkbox" name="Zahlmethode" id="box" value="" onclick='setzen()' style="background-color:#ffffff">Checkbox

</body>
</html>
[/code]

Frank

genau das hab ich gesucht! vielen dank ++

2. frage

ich übergebe nun über post oder get einen wert, der mir sagt welche checkbox checked ist. nun möchte ihc das die checkbox dann auch schon farbig ist wenn sie von vornerein checked ist! gibts da nen befehl? anstatt onClick ?!

hat sich erledigt, habs schon hinbekommen

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.