-2
I want to create a javascript function that adds the year 1993 + current ano_and that inserts the result into my <span class="title_25anos" id="calculo_ano"></span></h1>
And this is my code.
<script>
var ano_inicio = 1993;
var ano_atual = getFullYear();
var soma_ano = ano_inicio + ano_atual;
document.getElementById("calculo_ano").innerHTML = "Há " . soma_ano . "anos com você";
</script>
What value you expect returns?
– Maury Developer
2019 - 1993 = 26 But this value needs to be automatic.
– Mike Otharan
There is another problem
22/05/1993
11/02/2019
return 26, being difference of 25– Maury Developer
Year difference value will be exact or approximate?
– Maury Developer
Will be approximated
– Mike Otharan
document.getElementById("calculo_ano").innerHTML = "Há " . soma_ano . "anos com você";
Why do you have these points? This is not php, but javascript.– Maury Developer