<table>
<tbody>
<tr>
<td>a.1</td>
<td>a.2</td>
</tr>
<tr>
<td>b.1</td>
<td>b.2</td>
</tr>
<tr>
<td>c.1</td>
<td>c.2</td>
</tr>
</tbody>
</table>Selection: rangeCount property / notebook
Selection: rangeCount property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
setInterval(() => {
console.log(window.getSelection().rangeCount);
}, 1000);