I need help. I’m trying out my new code learning on building a budgeting app but I cant get this section working right. I’m probably way off so be kind…
Can you tell us what you are trying to do and what is not working?
This is section of a project I’m working on for a budgeting tool. The part I’m stuck on, for now, adds monthly income where you enter the amount of your check, select weekly, bi- weekly or monthly and using js functions to output your monthly income. This is basically a private project to help me understand js functions better
You have several issues there, let’s start with the HTML:
<input/>tags are self-closing
<input></input>is invalid HTML)
in your function, you create a
<p>element to display the outcome, but you don’t put it into the DOM (that would be done with
document.body.appendChild(newP)). However, that would append a new
<p>tag each time you click the button. I’d suggest you put an empty
<p>tag into your HTML instead, and then only change its text content
you’re not using the
.innerHTMLmethod correctly, the only thing on the right side of the
=should be a string
finally, you have a typo in
Fixing all that will make your code work. By the way, you can access the console in codepen (lower left corner), you’ll see some errors that will help you debug.