সম্পাদনা
<!DOCTYPE html> <html> <body> <button id="button">ক্রিয়েট</button> <script> function execute() { const event = document.createEvent("Event"); event.initEvent("custom", true, true); button.dispatchEvent(event); } button.addEventListener("custom", () => { button.textContent = "ইভেন্ট"; }); execute(); </script> </body> </html>
পূর্বরূপ