<input id="inp"></input>
<button type="button" onclick="fibbon();">Submit!</button>
<p id="JS"></p>
<script>
var n = document.getElementById("inp").value;
var fibbon = function(n){
if ((n===1) || (n===2)){
return 1;
}
else{
return fibbon(n-1)+fibbon(n-2);
}
document.getElementById("JS").innerHTML = fibbon;
};
</script>
I am trying to get this to work with the input, but it doesn't display the number when I put in a number