passing javascript variable to html for display
html, javascript
Solution
You need `parseFloat(document.getElementById("loanamount").value)` most probably
TIP: Instead of `parseFloat`, just use `+` to convert from strings to numbers. So `+document.getElementById("loanamount").value` should also serve your purpose.
Problem
I am using the following ``` var loan = parseFloat(document.getElementById("loanamount")); document.getElementById('numpay').textContent = loan.toString(); ``` and my html is this: ``` <p>Number of Payments: <a id="numpay"> </a> </p> ``` I feel like this should be working but cannot seem to get anything other than NaN in my html, no matter how I configure it. I know I am a novice at javascript but could you please give me a tip? Thanks!