-1
<!doctype html>
<html>
<body>
<input type="text" name="text" id="text"/>
<input type="button" name="button" value="wert" id="button" class="button" Onclick = "wert()"/>
<script>
function wert() {
var o = document.GetElementById('text').value;
var nome = "antonio";
var ok = nome = o;
var ok = true;
if(ok){
alert("oi antonio")
else {alert(oi desconhecido)}
}
}
</script>
</body>
</html>
This is full of syntax errors. Missing key before the
else
, quotes in text, parentheses,...– Augusto Vasques
In addition to syntax errors, your condition will always be true, because the ok variable takes a true;
– Daniel Mendes