Sorry about question title I didn't know what to type.
I want to know how you always check for statement update here is what I mean and here is my code:
// This Works
var car = $( "div#car" ).text();
if (car == 0) {
document.getElementById("car").value = "Some_value";
} else if (car == 1) {
document.getElementById("car").value = "Some_value";
}
I want always check for car value. When I write that code to console it only runs once. I want the code to repeat itself. I tried this but the code doesn't work in function. Why?
// Doesn't work
var car = $( "div#car" ).text();
function checkcar() {
if (car == 0) {
document.getElementById("car").value = "Some_value";
} else if (car == 1) {
document.getElementById("car").value = "Some_value";
}
}
So how to check for car value and always do/repeat the if else statement...