<script>
function getDef() {
document.getElementById("defCanvas").innerHTML=document.getElementById("invisibleDefFrame").contentWindow.document.getElementsByClassName("def-content")[0].innerText;
}
</script>
<button onclick="getDef();">Get Definition</button>
<iframe style="display:none;" id="invisibleDefFrame" src="http://dictionary.reference.com/browse/amalgamation?s=t"></iframe>
<p id="defCanvas"></p>
This is my code for a program that should return the definition of a word, but instead does nothing. What should I do to fix it? Thanks.