How to pass the result of this script to a field and have already returned formatted in Real Currency
</head>
<body>
<input type="checkbox" id="iv"/></br>
<input type="text" id="campo" value="10"></br>
<select name="children-qnt" id="children-qnt">
<option value="0">0</option>
<option selected value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
Result: <span id="resultado">10</span>
<script type="text/javascript">
var $campo = byId('campo'),
$select= byId('children-qnt'),
$checkbox = byId('iv');
function byId(element){
return document.getElementById(element);
}
function updateResult(){
var result = parseInt($campo.value) *
parseInt($select.value);
byId('resultado').innerHTML = $checkbox.checked ? result * 2 : result;
}
$campo.addEventListener('keyup', updateResult);
$select.addEventListener('change', updateResult);
$checkbox.addEventListener('change', updateResult);
</script>