How to display HTML tags and copy it as plain text with Javascript

I want to display this command echo "<?php phpinfo(); ?>" using div tag and copy it by pressing the copy button. I try this,

<!DOCTYPE html>
<html>
<head>  
</head>
<body>
<div type="button" id="content">echo "<? phpinfo(); ?>"</div>
<button onclick="copyToClipboard()">Copy</button>

<script>
  function copyToClipboard() {
    var copyText = document.getElementById("content").innerHTML;
    navigator.clipboard.writeText(copyText).then(() => {
    console.log(copyText);
    });
  }
</script>
</body>
</html>

but it only display echo "" and in console I see echo "<!--? phpinfo(); ?-->"

Then, I use entity number like this echo "&#60? phpinfo(); ?&#62" or entity name like this echo "&lt;? phpinfo(); ?&gt;" it displays correctly but when I press the copy button, I get the string with entity name or number which is not that I want.

How can I solve this?