I'm making a website for my mobile app, the truth is that I do not know much about Javascript (nothing really) and I have almost everything I need, the only thing that is giving me problems is this code if (), the which apparently does not recognize the variables because I do not execute the code that I have inside it if (), so if I use that same code outside of the if () it works perfectly, that's why I think it should be a problem of the variables inside the if ().
This is the famous if ()
function btnmasAClick() {
var numero = parseInt(document.getElementById('number').value, 10);
numero = isNaN(numero) ? 0 : numero;
numero++;
document.getElementById('number').value = numero;
var postElement4 = document.getElementById("postElement4");
if (numero == postElement4) {
//hago algo
}
var updateStarCount4 = function(element4, value) {
element4.textContent = value;
};
var starCountRef4 = firebase.database().ref().child("user").child("lista-user").child(numero+'').child("Edad");
starCountRef4.on('value', function(snapshot) {
updateStarCount4(postElement4, snapshot.val());
});
}
So I show the data received from the Firebase Database in the HTML code
<td id="postElement4"></td>
If you could help me it would be great, because of Javascript I do not really know much ... Of course, thank you very much for your time!