How to use JS or JQ to force a click on the element while holding Shift?

Good afternoon.
You need to make a click on the selected element, click with the shift key held down, I need to generate the event, not to listen to him. If it is possible to do it with JQ or native I would be grateful for an example.
August 19th 19 at 23:03
1 answer
August 19th 19 at 23:05
Solution
www.spookandpuff.com/examples/clickSimulation.html

simulatedClick function(target, options) {

 var event = target.ownerDocument.createEvent('MouseEvents'),
 options = options || {},
 opts = { // These are the default values set up for un-modified left clicks
 type: 'click',
 canBubble: true,
 cancelable: true,
 view: target.ownerDocument.defaultView,
 detail: 1,
 screenX: 0, //The coordinates within the entire page
 screenY: 0,
 clientX: 0, //The coordinates within the viewport
 clientY: 0,
 as the ctrlkey property: false,
 altKey: false,
 shiftKey: false,
 metaKey: false, //I *think* 'meta' is 'Cmd/Apple' on Mac, and 'Windows key' on Win. Not sure, though!
 button: 0, //0 = left, 1 = middle, 2 = right
 relatedTarget: null,
};

 //Merge the options with the defaults
 for (var key in options) {
 if (options.hasOwnProperty(key)) {
 opts[key] = options[key];
}
}

 //Pass in the options
event.initMouseEvent(
opts.type
opts.canBubble,
opts.cancelable,
opts.view
opts.detail
opts.screenX,
opts.screenY,
opts.clientX,
opts.clientY,
opts.as the ctrlkey property,
opts.altKey,
opts.shiftKey,
opts.metaKey,
opts.button
opts.relatedTarget
);

 //Fire the event
target.dispatchEvent(event);
}

Find more questions by tags JavaScriptjQuery