0
I have a code, where I want to display the result of a sum without reloading the page. As an example, I have already set initial values in the fields.
*Problem: I have one div
id resultado
that has a css to hide it in initial state. Clicking on the calculate button has a function to display the div
.
There is another function that will take the values of the fields input
and display the result within the div
with id
normal
. This div
is inside the div
with id
resultado
.
But I don’t know why div
id resultado
is not being displayed. Only the div
with id
normal
with the result. If I remove the function that sums up and click on the div
id resultado
is displayed normally.
is not working normally if you look at
div
main withid
resultado
has within it a title, the same is not displayed due todiv
main not being displayed.– Wendell
Nice try, but answers like this better not work, right?
– leandroungari
looks vc ta replacing all content of div by the result. so does not show Document.getElementById("normal"). innerHTML = (a / b); Everything within the normal div is replaced by the value. so the title is deleted
– Jasar Orion
test this http://codepen.io/anon/pen/bZXZgZ
– Jasar Orion