نموونەی لاپەڕەیەکی وێب
لێرە دەستکاری وردەکارییەکان بکە شێرەکەم
ناونیشانی بەشەکە
ڕیزبەندی
دەربارە
بینینی نموونەیەکی کارا لە پێکهاتەی دوگمە و وێنە لە وێبدا.
ئاماژە
بڵاوی کەرەوە
ناونیشان
وەسف
HTML
<h1>Guess the letter</h1> <h2>_ O G</h2> <div id='letterButtons'> <button>Q</button> <button>R</button> <button>D</button> </div>
CSS
body { font-family: sans-serif; text-align: center; background-color: #9aa4d2; color: #2C3E50; } button { width: 40px; height: 40px; background-color: #34495E; color: #FFF; border: none; border-radius: 5px; margin: 7px; cursor: pointer; }
JS
document.querySelectorAll('button').forEach(b => b.addEventListener('click', () => alert(b.textContent === 'D' ? 'ڕاستە!' : 'دووبارە هەوڵ بدەرەوە!')));