LOOP em mla funcionamento[erro de logica]

HTML

CSS

JavaScript

HTML5

07/11/2020

Mim ajudem pfv

function js() {
			var res = document.querySelector('.res')
			var ml = Number(document.querySelector('.ml').value)
			var meta = document.querySelector('.barra-meta')
			var media_meta = document.querySelector('.media-meta')
			if (ml == "" || ml.length == 0) {
				res.innerHTML = "Ml inválido"
				event.preventDefault()
				return false
			}
			if (ml < 0 || ml.length < 0 || ml == 0 ) {
				res.innerHTML = `ML inválido`
				event.preventDefault()
				return false
			}else{
			for (var rel = Number(0);rel < 2001; rel=rel+ml){
				var rel = rel
				media_meta.innerHTML = `$`
				document.querySelector(".add_agua").style.display = "none"
				document.querySelector('#home').style.opacity = '1'
				if (rel>249){
					meta.style.width = "6%"
				}
				if (rel>599){
					meta.style.width = "13%"
				}
				if (rel>999){
					meta.style.width = "24%"
				}
				if (rel>1249){
					meta.style.width = "31%"
				}
				if (rel>1499){
					meta.style.width = "37%"
				}
				if(rel>1999){
					meta.style.width = "48%"
					document.querySelector('#home').style.opacity = '0.2'
					document.querySelector("#parabens").style.display = "block"
				}
			}

			//media_meta.innerHTML = `$`
		}
	}
Wagner

Wagner

Curtidas 0
POSTAR