Modal auto select text

Hi,

I have set up a Modal Window to share a link to another page in my website.

The modal pops up once someone click a share icon and a link appears. The link is currently a paragraph piece of text but I would like it to be auto selected, similar to a input form box is on auto focus so that it is simple to copy and paste.

Is there a way to do this?

Thanks
Chris