Currently, I am using the document.onmouseup event to select text. However, my code only allows me to specify one input. How can I modify it to select text from the first row and place it into the input in the first row, and do the same for the second row?
The following is the code snippet (source: On Text Highlight Event?):
var t = '';
function getSelectedText(e) {
t = (document.all) ? document.selection.createRange().text : window.getSelection();
document.getElementById('input1').value = t;
}
document.onmouseup = getSelectedText;
if (!document.all) document.captureEvents(Event.MOUSEUP);