Considere o seguinte código HTML e script javascript
<!DOCTYPE html>
<html>
<body>
<button onclick=”Funcao()”>Clicar</button>
<p id=”MP”></p>
<script>
function Funcao() {
var str = “Concurso MP”;
var n = str.search(/mp/i);
document.getElementById(“MP”).innerHTML = n;
}
</script>
</body>
</html>
<html>
<body>
<button onclick=”Funcao()”>Clicar</button>
<p id=”MP”></p>
<script>
function Funcao() {
var str = “Concurso MP”;
var n = str.search(/mp/i);
document.getElementById(“MP”).innerHTML = n;
}
</script>
</body>
</html>
O resultado da função Funcao ao clicar no botão Clicar em um browser (o valor de innerHTML do elemento cujo id é “MP”) é: