I have the following code
function nomes() {
function funcao() {
alert("teste");
}
function funcao2() {
alert("teste2");
}
}
<input class="todas" id="checkall" type="checkbox" onclick="funcao2();">
When trying to execute function 2 through the checkbox the following error occurs: function2 is not defined
What is the correct way to call this function?