I have a gender selector, and a script that gets the value of the selected gender and pastes it on a label, but it's pasting the value: "M" or "F".
<div name="userLabelDiv" id="genderUserLabelDiv">
<label class="required">Sexo</label>
<label id="genderLabel">F</label>
</div>
Now when I'm trying to get this letter and replace for the actual gender, I'm missing on the JS script. Could you help me?
$("#genderLabel").html(
if ($(this).value == 'F') {
this.value = 'Female';
}
if ($(this).value == 'M') {
this.value = 'Male';
}
);
I know the script is probably wrong, could someone correct it, please? Thank you!