This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
div-Elemente einblenden
#1
Hallo,

Ich möchte über ein Dropdown das ausgewählte div-Objekt einblenden und die anderen 2 ausblenden. 
Das Grundgerüst habe ich schon, nur weiss ich nicht, wie ich den Rest machen soll.

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <select name="dropdown" id="dropdown" onchange="berechne()" >
        <option value="">Auswahl</option>
        <option value="1">div1</option>
        <option value="2">div2</option>
        <option value="3">div3</option>
        </select>

        <div id="div1">
            <p>Das ist div1.</p>
        </div>

        <div id="div1">
            <p>Das ist div2.</p>
        </div>

        <div id="div3">
            <p>Das ist div3.</p>
        </div>
</body>
</html>

Danke
Walter
Zitieren
#2
Mit Klassen und nativ Javascript
https://basti1012.bplaced.net/index.php?ordner=javascriptforum&id=462

Dann kannst du fade in und sowas selber zusammen nageln
Als Lösung markieren Zitieren
#3
Danke!
Als Lösung markieren Zitieren


Gehe zu:


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