You cant load from files on server from client side cuz that would be a huge no-no when it comes to security. Just imagine that. You need some back-end (server side) language like PHP.
Here is the most basic PHP code ( with comments ) that does what you want:
<?php
// you put your filename here ( obviously )
$fileName = "girl.txt";
// opening and reading file
$fileH = fopen( $fileName, "r") or die("Unable to open file!");
$fileCont = fread( $fileH,filesize( $fileName));
fclose($fileH);
// split text into lines
$lines = explode( "\r\n", $fileCont);
$numOfLines = count($lines);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- import math module -->
<script src=https://cdnjs.cloudflare.com/ajax/libs/mathjs/3.3.0/math.min.js></script>
</head>
<body>
<!-- prints random choice to html code -->
<h1>I Love</h1>
<button>Click Me!</button>
<script>
// print php array into js
<?php echo "lines = ['".join("', '", $lines)."'];\n"; ?>
maxLineNum = <?php echo $numOfLines; ?>;
// on button click you get random msg in h1
document.querySelector("button").addEventListener( "click", ()=>{
randNum = math.floor( math.random()*maxLineNum );
document.querySelector("h1").textContent = "I love " + lines[randNum];
} );
</script>
</body>
</html>