js 이벤트 자동 실행

1949 단어

문장 자동 평론

setInterval(function(){
    var text=document.getElementsByTagName("textarea")[0];
    var eventtext = document.createEvent('Event');
    eventtext.initEvent('focus', true, false);
    text.dispatchEvent(eventtext)
    text.value="1111"+Math.random();
    (function(){
        var text=document.getElementsByTagName("textarea")[0];
        var eventtextkey = document.createEvent('Event');
        eventtextkey.initEvent('change', true, false);
        text.dispatchEvent(eventtextkey);
    })();
    (function(){
        var text=document.getElementsByTagName("textarea")[0];
        var eventtextkey = document.createEvent('Event');
        eventtextkey.initEvent('compositionend', true, false);
        text.dispatchEvent(eventtextkey);
    })();
    (function(){
        var text=document.getElementsByTagName("textarea")[0];
        var eventtextkey = document.createEvent('Event');
        eventtextkey.initEvent('compositionstart', true, false);
        text.dispatchEvent(eventtextkey);
    })();
    (function(){
        var text=document.getElementsByTagName("textarea")[0];
        var eventtextkey = document.createEvent('Event');
        eventtextkey.initEvent('input', true, false);
        text.dispatchEvent(eventtextkey);
    })();
     (function(){
        var text=document.getElementsByTagName("textarea")[0];
        var eventtextkey = document.createEvent('Event');
        eventtextkey.initEvent('keydown', true, false);
        text.dispatchEvent(eventtextkey);
    })();

       (function(){
        var a=document.getElementsByClassName("btn-send")[0];
        var event = document.createEvent('Event');
        event.initEvent('click', true, false);
        a.dispatchEvent(event);
        })()
},3000)

좋은 웹페이지 즐겨찾기