Moving the mouse pointer in JavaScript

Is it possible to move the mouse so that it is located inside the text input using JavaScript?

+17
source share
4 answers

I don’t know how to move the actual rendered mouse, but can you just set focus on the element?

document.getElementById('the_text_input_id').focus()
+21
source

Please see this question:

Mouse move on element

In addition, I think that you are making a big design mistake by taking control of any user input in any way (perhaps besides setting the focus of the form element)

+6
source

, :

    function textSelect(inp, s, e) {
        e = e || s;
        if (inp.createTextRange) {
            var r = inp.createTextRange();
            r.collapse(true);
            r.moveEnd('character', e);
            r.moveStart('character', s);
            r.select();
        }else if(inp.setSelectionRange) {
            inp.focus();
            inp.setSelectionRange(s, e);
        }
    }

12- :

textSelect(document.getElementById('theInput'), 12);

:

textSelect(document.getElementById('theInput'), 12, 15);
+6

[security?], - . : setInterval (function() {moveMouseToTopLeftCorner }, 1)...
. ( enter), .

, taskmanager p > _ >

, , ActiveX [ IE... ]

0

All Articles