// Write JavaScript here
(function() {
var contador = 0;
document.getElementById('play').addEventListener("click", identificar);
function identificar() {
contador === 2 ? play.disabled = true : contador++
}
});
<!DOCTYPE html>
<html>
<head>
<title>HTML5, CSS3 and JavaScript demo</title>
</head>
<body>
<input id="play" type="button" value="Jugar"/>
</body>
</html>
The error is in the funcion identificar
, but in the Google console it appears:
Uncaught SyntaxError: Unexpected identifier
So, I do not know what the error is.
And second thing, how can more than one instruction be included if true
comes out in the ternary operator?