Notice
Recent Posts
Recent Comments
Link
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags more
Archives
Today
Total
관리 메뉴

난 정말 최고야 멋있어

[HTML+JS] Simple Keylogger 본문

카테고리 없음

[HTML+JS] Simple Keylogger

n00bh4cker 2019. 12. 11. 12:49

<!DOCTYPE html>

<html>

    <text id="text" readonly>

    <script type="text/javascript">

    let text = document.getElementById('text');

    let keys = '';

    document.onkeydown= (e)=>{

        if (e.key)

            keys +=  e.key;

        text.textContent = keys;

    }

    </script>

</html>

onkeydown 을 이용한 이유 : onkeypress 를 이용하면 백스페이스나 쉬프트 키 같은 특수한 키들의 입력은 받지 못함