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
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
InscribirsePublicaciones relacionadas | Respuestas | Vistas | Actividad | |
---|---|---|---|---|
|
1
oct 20
|
4401 | ||
|
1
jun 25
|
89 | ||
|
1
may 25
|
787 | ||
|
0
mar 25
|
416 | ||
|
1
dic 24
|
3020 |