[Vuejs]-How can we trigger shift+click for vue js elements in browser console

0👍

I got this solution in javascript dispatchEvent.

function simulateClick({
  ctrl = false, alt = false, shift = false, meta = false
} = {}) {

  var evt = document.createEvent("MouseEvents");
  evt.initMouseEvent("click", true, true, window,
    0, 0, 0, 0, 0, ctrl, alt, shift, meta, 0, null);

  return evt;    
}

document.getElementById(...).dispatchEvent(simulateClick({shift: true}))

It’s working for my scenarios. So now I can able to trigger the shift+click event for particular elements.

Leave a comment