Check out example codes for "how to make a html prank virus". It will help you in understanding the concepts better.

Code Example 1

COPY THIS AND SAVE TO NOTEPAD AS "fakevirus.htm"
<!DOCTYPE html>
<html>
<body>
<img style = "width: 8%; ; " src="https://www.w3schools.com/images/stop.gif"  alt=""  />
<h1> THERE IS A VIRUS DETECTED IN YOUR COMPUTER <h1/>
<p> get fakeavast.exe to get rid of this virus <p>
<script>
function openWin()
{
myWindow=window.open("","","width=200,height=100");
myWindow.document.write("<p>LOL GET TROLLED</p>");
}

</script>

</body>
</html>

Learn ReactJs, React Native from akashmittal.com