I want to press any key suppose p or CTRL+F, Is it possible in javascript?
Note: I am not talking regarding key press event. Just like when user press any key in keyboard manually, I want key press using javacsript button.
I want to press any key suppose p or CTRL+F, Is it possible in javascript?
Note: I am not talking regarding key press event. Just like when user press any key in keyboard manually, I want key press using javacsript button.
If it possible in JS it would be a great security issue. This possibly only using JS + some OS tools. For example, WScript object for win platform.
var oShell = CreateObject("WSH.WScript");
oShell.SendKeys("^F"); // Ctrl+F
UPDATE
<input type="button" name="find" value="find" onclick="find();" />
This method may helps but it only works in firefox. chrome,safari,IE are not supported.
I understand your question, but Why should you need to do that? If you explain the reason, we may give some other suggestion.
But this is not possible in javascript to trigger a keypress without it happen actually. as alex said it may be an security issue.