0
I want to click on Flap Change the class of the div that contains the attribute to show. It is originally with a class that makes it hidden.I have the js function there but it’s not working
Who can help thank you. I hope the post is good
var div = document.querySelector('div#minhaDiv');
var section = document.querySelector('section#secao');
section.addEventListener('click', function() {
var aberto = div.classList.contains('teste');
div.classList.toggle('teste2');
this.innerHTML = aberto ? 'teste2' : 'teste';
.teste{
display: none;
}
.teste2{
display: block;
}
<div class="teste" id="minhaDiv">
Filtro busca2:
<select name="" onchange="" id="">
<option value="0">...</option>
<option value="1">Prazo decrescente</option>
<option value="2">Prazo crescente</option>
<option value="3">Título A - Z</option>
<option value="4">Título Z - A</option>
</select>
</div>
<section id = "secao" onclick = "">
<p class="title" data-section-title>
<a href="#">Tarefas Cadastradas</a>
</p>
<div class="content" data-section-content>
<table class="responsive" width="100%">
<thead>
<tr>
<th width="15%">A Tarefa</th>
<th width="15%">Funcionário</th>
<th width="15%">Setor</th>
<th width="5%">Status</th>
<th width="10%" style="text-align:center;">Prazo</th>
<th width="10%">Nível Urgência</th>
<th width="10%">Dia Fechamento</th>
<th width="7%" style="text-align:center;">Editar</th>
<th width="7%" style="text-align:center;">Excluir</th>
</tr>
</thead>
<tbody>
It was at necklace time that I put one
tbody
over there. I don’t know what’s going on so it must be something in the rest of the script thanks for your attention– Lucas Machado
@Lucasmfindingwithout problems my dear, if solved is what matters rss []s
– hugocsl
It was not working yet but putting the javascript inside a
window.onload()
worked.– Lucas Machado
@Lucasmunded to yes, it would be a good practice even, how good that it worked there :)
– hugocsl