`I'm trying to calculate the cost of a property deed change based on the reason for the change and the user-inputted loan amount. With the code so far, I'm able to calculate and send an alert for reasons 3 and 4, but the other reasons aren't outputting the appropriate alert/cost. Some of the code is probably redundant, but this is one of my first projects so please cut me some slack.
HTML
<select id="menu" required>
<option value="r0">Select</option>
<option value="r1" id="reason" class="reason">1. Corrective Deed</option>
<option value="r2" id="reason" class="reason">2. Deed Pursuant to a Dissolution</option>
<option value="r3" id="reason" class="reason">3. Deed to Remove Spouse from Primary Residence Without Dissolution</option>
<option value="r4" id="reason" class="reason">4. Deed to Add a Co-borrower Who is Not Currently on Title. The Co-borrower has to be on the loan and this has to be a Primary Residence.</option>
<option value="r5" id="reason" class="reason">5. Deed to Add Spouse Even if They Are Not on the Loan</option>
<option value="r6" id="reason" class="reason">6. Deed to Remove or Add an Owner on Investment Property or 2nd Home (Only if Requirement of Our Loan)</option>
<option value="r7" id="reason" class="reason">7. Deeds to Take Property Out of a Trust</option>
<option value="r8" id="reason" class="reason">8. Deeds to Take Property Out of a Life Estate</option>
<option value="r9" id="reason" class="reason">9. Deeds Where We are Transferring Full Ownership to Our Borrowers*</option>
</select>
JavaScript
function calculateCost() {
let r = document.getElementsByClassName("reason").value;
let a = document.getElementById("amount").value;
if (r === 'r3' || 'r4') {
cost34 = ((a / 2) * 0.0070);
} else if (r === 'r5') {
cost = 0.0070;
} else if (r === 'r6' || 'r8' || 'r9') {
cost = (a * 0.0070);
} else {
alert("N/A");
}
alert("Total Cost of Deed Change: $" + cost);
};