How to trigger touchstart?

  • 0
    Hello, there is a horizontal slider on someone else's site.
    The site itself binds two events mousedown and touchstart, when using the mouse, the values ​​in the data- attributes change on the element. the value is set through the slider from 1 to 100.
    Can you please tell me if it is possible to activate this slider programmatically through js to set its value?
    dispathEvent with changed value in data- fires nothing
    JavaScript Emma McPherson, Mar 28, 2019

  • 1 Answers
  • 0
    That is, programmatically hold down the mouse / touch and pull? No, you can't. Mouse movements cannot be emulated for security reasons, they are readable only.

    Why is this needed? If, in order to send this data to the server, you just need to set the required value to some input (presumably), nothing needs to be triggered.
    Ronan Moses

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!