Przejdź do treści
<code>pen.pl

Nowy pen

Interfejs

Podgląd

Ładowanie podglądu…

WP

0,0 / 5 Brak ocen

Kod źródłowy

Licencja MIT — także do użytku komercyjnego. Zachowaj informacje o autorze i licencji.

HTML
<main class="container">
  <h1>Nowy pen</h1>
  <button id="btn">Kliknij</button>
  <p id="info" aria-live="polite"></p>
</main>
CSS
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #282335;
  font-family: system-ui, sans-serif;
}

.container {
  padding: 24px;
  text-align: center;
}

button {
  padding: 12px 28px;
  border: 1px solid #5d3979;
  background: #fff;
  color: #5d3979;
  font: inherit;
  cursor: pointer;
}
JavaScript
const btn = document.getElementById('btn');
const info = document.getElementById('info');

btn.addEventListener('click', () => {
  info.textContent = 'Działa! ' + new Date().toLocaleTimeString('pl-PL');
});

Edytuj swój pen

Podaj adres e-mail użyty przy zapisie. Wyślemy link do edycji.

Link jest ważny przez 30 minut.