I want to access the text within an ElInput component via Javascript in Electron. According to mozilla it is impossible to access information within an html input or textfield via window.getSelection.
I unsuccessfully tried to access the selection with the proposed selectionStart
const input = document.getElementById("input")
alert(input.selectionStart.toString)
Given that this doesn't work, what do I have to do, to get the text in my selection within my el-input?

Based on this answer: How to get selected text from textbox control with javascript you can use Document.querySelectorAll() to get all
elementsyou need. You can useclass names,idsortag namesand so on. Then iterate over them with forEach and add the EventListener you need. Inside theforEachloop you can do whatever you like with any givenelementUPDATE Unfortunately the first solution did not work in Firefox. (see further down) This solution should work in more browsers.
First solution (hidden in the "Show code snippet") unfortunately
window.getSelection()did not work in Firefox. I'll keep this solution here just because maybe someday it will work and then this would be the nicer solution.