<!DOCTYPE html>
<
html
>
<
head
>
<
title
>Web API</
title
>
</
head
>
<
body
>
<
script
>
function clickHandler() {
let selection = window.getSelection();
selection.modify('extend', 'backward', 'paragraph');
}
</
script
>
<
h1
style
=
"color:green"
>GeeksforGeeks</
h1
>
<
h3
> Web API selection modify method</
h3
>
<
p
>Here is some garbage text just to show the
usage of the modify method.<
br
/>
Some more text here. Some extra text. Some
more text here. Some more text. Some more text.</
p
>
<
p
>Here is some garbage text just to show the
usage of the modify method. Some more text here.
Some extra text. Some more text here.<
br
/>
Some more text. Some more text.</
p
>
<
p
>Here is some garbage text just to
show the usage of the modify method.<
br
/>
Some more text here.<
br
/>
Some extra text. Some
more text here. Some more text.
Some more text.</
p
>
<
button
type
=
"button"
onclick
=
"clickHandler()"
>
Click Here!!!
</
button
>
</
body
>
</
html
>