I’m new to net improvement and have been self educating for three months. I’m making a webapp that helps finances earnings. I’m on the stage the place I ask the person to make use of my calculator to calculate annual earnings. Step one can be discovering weekly earnings. I wrote some html code and it runs however I get the error:
Your Weekly Earnings is[object HTMLHeadingElement]. I used internal html and doc.getelementbyid to resolve this subject.
<!DOCTYPE html>
<html>
<head>
<hyperlink rel="stylesheet" sort="textual content/css" href="kinds.css">
<meta charset="utf-8">
<title>Annual Earnings Calculator</title>
<script sort="textual content/javascript">
perform calculateIncome()
{
var Annual_income;
var Net_income;
var hourly_rate = doc.getElementById("hourly_rate").worth;
var hours_per_week= doc.getElementById("hours_worked").worth;
var weekly_income = parseFloat(hourly_rate)*parseFloat(hours_worked);
if(isNaN(weekly_income))
{
doc.getElementById("weeklyincome").innerHTML = "Your Weekly Earnings is"+ weeklyincome;
console.log(1);
}
}
</script>
</head>
<physique>
<h2 id = "weeklyincome">Your Annual Earnings</h2>
<label for="earnings">What's Your Hourly Charge</label>
<enter sort="quantity" identify="earnings"id="hourly_rate"><br>
<label for="earnings">What's Your Hours Labored Per Week</label>
<enter sort="quantity" identify="hours"id="hours_worked"><br>
<button onClick="calculateIncome()"sort ="Submit">Calculate</button>
</physique>
</html>