I have this javascript function
function addTenPercent(){
var bar = document.getElementById("progressBar");
setInterval(addTenPercent, 5000);
bar.value += 10;
};
I am trying to include it on my jquery if else statement but with no luck
$('#form1').submit(function(e){
if ($.trim($('#store').val()) === "" || $.trim($('#store').val()) === "Enter store number'(nnnn)'") {
e.preventDefault();
alert('Please type in store number');
}
else {
setInterval(function(){
$('#progressBar').val() += 10;
},5000);
}
});
Can someone help point where did i go wrong on converting the said javascript to jquery?