Hỏi đáp

Chia sẻ kiến thức, cùng nhau phát triển

minh can 1 code như thế này nhưng có thể click vào nhiều điểm cùng lúc dược k ạ

15:08 17-04-2025 48 lượt xem 0 bình luận

(function() {
const BUTTON_CLASS = 'sorting';
const DELAY_MS = 1000;
function clickButton() {
const button = document.querySelector(`.${BUTTON_CLASS}`);
const buttonText = button.textContent.trim();
if (button) {
console.log('Đã tìm thấy button, đang click...');
const clickEvent = new MouseEvent('click', {
bubbles: true,
cancelable: true,
view: window
});
button.dispatchEvent(clickEvent);
button.click();
}
}
if (document.readyState === 'complete') {
setInterval(function (){
clickButton();
},400)
} else {
window.addEventListener('load', function() {
setTimeout(clickButton, DELAY_MS);
});
}
})();

Bình luận

Để bình luận, bạn cần đăng nhập bằng tài khoản Howkteam.

Đăng nhập

Câu hỏi mới nhất