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
"OK" Button in Popup ändern
#1
Hallo,
Kann mir jemand weiterhelfen ich verzweifle gerade ein wenig :/
Ich habe ein Popup erstellt welches eine Zufallsnummer zwischen 1 und 23 generiert.
Ich hätte nun aber gerne, dass auf dem Popup der "ok" Knopf mit einem "Schließen" Knopf ausgetauscht wird.
So sieht mein Code gerade aus:
<head>
<script>
    function randomNumber(){
        var num1 = Math.floor(Math.random() * 23) + 1;
        alert("Zufallsnummer: " + num1)
     
    }
 
    </script>
</head>
<body>
  <body onload="randomNumber()">
</body>
Danke schonmal im Vorhinein Smile
Zitieren
#2
Meines Wissens nach gibt es bei alert() keine Gestaltungsmöglichkeit. Das Aussehen ist vom Browser abhängig. Du kannst dir aber ein eigenes Dialogfenster basteln. Siehe auch hier.
Als Lösung markieren Zitieren


Gehe zu:


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