How can I display the text let text: string inside a specific tag using typescript and getElementById?
Code for index.html
<!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>
<script src="./index.js"></script>
</head>
<body>
<h1>Typescript Exercise</h1>
<p id="text">Text: </p>
</body>
</html>
Code for index.ts
let text: string = 'Typescript Exercise';
let textElement = document.getElementById("text") as HTMLElement | null