cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <body>

<p>Η Math.random() επιστρέφει ένα τυχαίο αριθμό ανάμεσα στο 0 και 1.</p>
<button onclick="Function1()">ΔΟΚΙΜΑΣΤΕ</button>
<p id="test1"></p>
<hr>
<p>Η Math.min() επιστρέφει την μικρότερη τιμή απο μία λίστα.</p>
<button onclick="Function2()">ΔΟΚΙΜΑΣΤΕ</button>
<p id="test2"></p>
<hr>
<p>Η Math.max() επιστρέφει την μεγαλύτερη τιμή απο μία λίστα.</p>
<button onclick="Function3()">ΔΟΚΙΜΑΣΤΕ</button>
<p id="test3"></p>
<hr>
<p>Η Math.round() επιστρέφει μία τιμή στον πιό κοντινό ακέραιο αριθμό.</p>
<button onclick="Function4()">ΔΟΚΙΜΑΣΤΕ</button>
<p id="test4"></p>
<hr>
<p>Η Math.ceil() επιστρέφει μία τιμή στον πιό κοντινό μεγαλύτερο ακέραιο αριθμό.</p>
<button onclick="Function5()">ΔΟΚΙΜΑΣΤΕ</button>
<p id="test5"></p>
<hr>
<p>Η Math.floor() επιστρέφει μία τιμή στον πιό κοντινό μικρότερο ακέραιο αριθμό.</p>
<button onclick="Function6()">ΔΟΚΙΜΑΣΤΕ</button>
<p id="test6"></p>
<hr>
 <p>Συνδυάζοντας την Math.floor() με την Math.random() έχουμε τυχαίους αριθμούς(π.χ. ανάμεσα στο 1 και το 10).</p>
<button onclick="Function7()">ΔΟΚΙΜΑΣΤΕ</button>
<p id="test7"></p>
<hr>
</body>
            
          
!
            
              function Function1() {
    document.getElementById("test1").innerHTML = Math.random();
}

function Function2() {
    document.getElementById("test2").innerHTML = Math.min(-1000, 15, 3, 200, -9, -100);
}

function Function3() {
    document.getElementById("test3").innerHTML = Math.max(-1000, 15, 3, 200, -9, -100);
}

function Function4() {
    document.getElementById("test4").innerHTML = Math.round(9.7);
}

function Function5() {
    document.getElementById("test5").innerHTML = Math.ceil(9.2);
}

function Function6() {
    document.getElementById("test6").innerHTML = Math.floor(8.9);
}

function Function7() {
    document.getElementById("test7").innerHTML = Math.floor(Math.random() * 11);
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console