let input = document.querySelector('input')
let cursorIndex = 0
if (input.selectionStart || input.selectionStart == 0) {
cursorIndex = input.selectionStart
}
console.log(cursorIndex)
let input = document.querySelector('input')
let cursorIndex = 0
if (input.selectionStart || input.selectionStart == 0) {
cursorIndex = input.selectionStart
}
console.log(cursorIndex)