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
相關帖文 | 回覆 | 瀏覽次數 | 活動 | |
---|---|---|---|---|
|
1
10月 20
|
4705 | ||
|
0
7月 25
|
252 | ||
|
0
6月 25
|
469 | ||
|
1
6月 25
|
708 | ||
|
1
6月 25
|
732 |