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.

Selected Option festlegen

Empfohlene Antworten

Frage an die Javascript Profis:

Ich hab ne Dropdownliste


<select id="sel"><option value=1>ersterwert</option>

<option value=2>zweiterwert</option></select>

Ich suche nen befehl, mit dem ich den ersten oder zweiten wert der liste selektieren kann, es ist eine einzeilige liste, bei der standardmäßig der erste eintrag angezeigt wird. nun soll aber per skript, z.b. der zweite wert angezeigt werden. meine idee, sowas wie:
document.getElementById('sel')[2].focus(); 

oder so ähnlich, geht eben leider nicht

hat sich erledigt, zugriff erfolgt mittels

document.getElementById('sel').selectedIndex=2; z.B., dies selektiert den dritten Eintrag, da der Index bei 0 startet

Syntax war nur falsch vorhin.

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.