how to press a keyboard "enter" inside my Js function?
function clickStoneName(x){
document.getElementById("in_StoneName").value = x;
var eF = document.getElementById("in_StoneName");
eF.focus();
// eF press kyboard Enter
}
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
how to press a keyboard "enter" inside my Js function?
function clickStoneName(x){
document.getElementById("in_StoneName").value = x;
var eF = document.getElementById("in_StoneName");
eF.focus();
// eF press kyboard Enter
}
Hi,
Try like following
function clickStoneName(x){
document.getElementById("in_StoneName").value = x;
var eF = document.getElementById("in_StoneName");
eF.focus();
const event = new KeyboardEvent('keydown', {
key: 'Enter',
code: 'Enter',
which: 13,
keyCode: 13,
charCode: 13,
bubbles: true,
cancelable: true,
});
eF.dispatchEvent(event);
}
Regards
Create an account today to enjoy exclusive features and engage with our awesome community!
Înscrie-teRelated Posts | Răspunsuri | Vizualizări | Activitate | |
---|---|---|---|---|
|
1
oct. 20
|
4792 | ||
|
0
iul. 25
|
160 | ||
|
1
iul. 25
|
4947 | ||
|
0
iul. 25
|
475 | ||
|
0
iun. 25
|
591 |