Good morning!
I'm having a problem I'm trying to return the value of a radio field by printing on the screen to give a type of return to the user before clicking the send. I'm currently testing on top of a script I found, but without much success is returning me NaN, I tried changing from parseInt to parseFlot but still unsuccessful.
<form>
<p>Now, with CSS3: </p>
<div class="cc-selector">
<input id="visa" type="radio" name="credit-card" value="20" onfocus="calcularPrimeiro()" />
<label class="drinkcard-cc visa" for="visa"></label>
<input id="mastercard" type="radio" name="credit-card" value="30" onblur="calcularPrimeiro()" />
<label class="drinkcard-cc mastercard"for="mastercard"></label>
</div>
</form>
<div id="resultado"></div>
<script type="text/javascript">
function calcularPrimeiro() {
var n1 = parseFloat(document.getElementsByClassName('credit-card').value, 0);
document.getElementById('resultado').innerHTML = n1;
}
</script>