ladybird/Tests/LibWeb/Text/input/textarea-selection-start-selection-end.html
Timothy Flynn c0d594568d LibWeb: Partially implement <textarea>'s selectionStart and selectionEnd
This implementation pretends we never have a selection. GitHub relies on
these values to know where to insert text corresponding to file uploads.
2024-03-16 13:11:57 +01:00

16 lines
517 B
HTML

<textarea id="textarea"></textarea>
<script src="include.js"></script>
<script type="text/javascript">
test(() => {
let textarea = document.getElementById("textarea");
textarea.focus();
println(`selectionStart: ${textarea.selectionStart}`);
println(`selectionEnd: ${textarea.selectionEnd}`);
textarea.value = "Well hello friends";
println(`selectionStart: ${textarea.selectionStart}`);
println(`selectionEnd: ${textarea.selectionEnd}`);
});
</script>