function calculateTax() { var income = document.getElementById(“income”).value; var frequency = document.getElementById(“frequency”).value; var annualIncome = income * frequency; var tax; if (annualIncome <= 237100) { tax=0.18 * annualincome; } else if (annualincome <=370500) + 0.26 - 237100); 0.31 370500); 0.36 512800); 0.39 673000); 0.41 857900); 0.45 1817000); var aftertaxincome=annualIncome tax; document.getelementbyid("beforetax").textcontent="Income before tax: R " document.getelementbyid("taxamount").textcontent="Tax amount: R " document.getelementbyid("aftertax").textcontent="Income after tax: R " aftertaxincome;