How do I randomly convert Li texts to links in Javascript?


I need to convert a list of Li texts into links using javascript, 3 links at random.
SEMrush

FROM THAT:

  • List 1
  • List 2
  • list 3
  • List 4
  • list ..
  • List 80
  • List 82
  • List 100
  • TO THIS:

    I have batch overflow search everywhere but can't find anything that fits my needs.

    Something like that:

    • List 1
    • List 2
    • list 3
    • List 4
    • list ..
    • List 99
    • List 100