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
|
4420 | ||
|
1
6月 25
|
193 | ||
|
1
6月 25
|
232 | ||
|
1
5月 25
|
800 | ||
|
0
3月 25
|
427 |