coding with ☕️
2 subscribers
262 photos
14 videos
11 files
165 links
Anwendungsentwicklung
Download Telegram
btns[1].classList.toggle('red')
/* ClassList va Delegatsiya */
const btns = document.querySelectorAll('button'),                 /* METHOD 1 */
wrapper = document.querySelector('.wrapper')
btns.forEach(item => {
item.addEventListener('click', () => { /* METHOD 2 */
console.log('CLICKED');
})
})
wrapper.addEventListener('click', event => {
if(event.target && event.target.matches(('button.red'))) { /* METHOD 3 - DELEGATSIYA */
console.log('CLICK');
}
})
const button = document.createElement('button')
button.classList.add('blue')
button.textContent = 6
wrapper.append(button)
window.addEventListener('DOMContentLoaded', () => {
})
 tabContent.style.display = 'none'
setTimeout(() => {
console.log('Hello World');

}, 2000);
// SetTimeout bu bitta function necha dur sekunddan keyin bir marotaba ishga tushadi
// SetInterval bu bitta function har necha dur sekunda ishga tushadi
const moveCar = () => {
const car = document.querySelector(".car");
let postion = 0;
const animationId = setInterval(moving , 5)

function moving() {
if (postion === 1000) {
clearInterval();
} else {
postion++;
car.style.left = postion + "px";
}
}
};

btn.addEventListener('click', moveCar)
const now = new Date('2025.02.19')
console.log(now);
Funksiya obyekt qaytaradi,