I have two buttons defined in HTML, [Male] and [Female].
<div class="gender-buttons" id="gender-buttons">
<button class="male-button">MALE</button>
<button class="female-button">FEMALE</button>
</div>
I want the values of the buttons to be set as below
- [Male] = 0.55
- [Female] = 0.68
The user will click which gender they are then will start a function.
<script>
function calculate(){
const genderMultiplier = document.getElementById("gender-buttons");
return genderMultiplier * 100;
};
</script>
How do I connect my HTML to JavaScript so that when the user clicks male, the function will use 0.55 in the function and vice versa with female?