I have seen some examples on the Internet but they have not worked for me in the way I require, and that is when I click on the id
one href
that is the same as one, div
it shows me the table that is hidden.
HTML CODE
<a href="#" id="display_table_students"> DB STUDENTS</a>
<br>
<div id="display_table_students" style="display: block;">
<table id="table_student" class="display" cellspacing="0" width="100%" style="display: none">
<thead>
<tr>
<th>Nombre</th>
<th>Apellido</th>
<th>Correo</th>
<th>Editar</th>
</tr>
</thead>
</table>
</div>
JS CODE
$('#display_table_students').click(function(e)
{
$("#formNewStudent").delay(100).fadeIn(100);
$("#formUpdatePassword").delay(100).fadeIn(100);
$("#formNewStudent").fadeOut(100);
$("#formUpdatePassword").fadeOut(100);
$('#register-form-link').removeClass('active');
$('#login-form-link').removeClass('active');
$(this).addClass('active');
e.preventDefault();
});
What's going on? I have some forms with a small effect eg:
REGISTRAR ESTUDIANTES | ACTUALIZAR ESTUDIANTES | DB STUDENTS <-(ESTOS SON LINKS)
Every time I press a link, one is hidden and the other is shown with a form. What I want is when I click on LINK DB STUDENTS
it, the table to which I put a is shown style= 'none'
, since if I remove this attribute or style, it is reflected in all links.
In a nutshell that only and exclusively as soon as DB STUDENTS
I click on the hidden table appears.
I hope you have made me understand and I appreciate your interest.
Take care of
id
duplicates,html
there should be no duplicates for this problem.Using
id
and this is duplicated tends to hide the first one that finds the link in this case.Now solving your case would be something like this using
id
uniques:Don't use duplicate id's, id's mean identifiers, try to make these unique identifiers, if you have two containers that are similar better use classes