how to detect url inside a textarea

chrome can detect url inside a textarea
select an url – right click – and you’ll see – go to ...
so I hope it is possible similar by clicking inside an url – get the href in console
the code below is probably a start but it results in entire body as selection
any idea?

document.onselectionchange = () => {
    var selection = window.getSelection();
<script src=""></script>
<textarea id='ed'>
lorem ipsum
dolor sit

66 thoughts on “how to detect url inside a textarea”

  1. Pingback: womens viagra
  2. Pingback: cheapest viagra
  3. Pingback: cheap viagra
  4. Pingback: viagra pills
  5. Pingback: cialis 24 hours
  6. Pingback: sildenafil online
  7. Pingback:

Leave a Comment