I tried to print the results of the function calculation() to the text area but it seems not working. Can you please help!
<head>
<title>Lab 6</title>
<script>
function calculate(){
for (var i=100; i<1000; i++) {
var x = i%10;
var y = Math.floor((i/10)%10);
var z = Math.floor((i/100)%10);
if (i== x*x*x +y*y*y + z*z*z) {
document.getElementbyTagname("textarea").innerHtml = i;
document.getElementbyTagname("button").addEventListener("click",
calculate());
}}}
</script>
</head>
<body>
<textarea rows="4" cols="50"> </textarea>
<button type="button">Click Me!</button>
</body>
</html>