7
I have several tags div
with the similar id, they all start with cn-, example:
<div id="cn-name">...</div>
<div id="cn-email">...</div>
<div id="cn-pass">...</div>
How can I interact with all of them without having to specify one by one? Would there be any way to do this at the beginning of it? For example:
/* no css */
#cn-* {
display:none;
}
/* no javascript/jquery */
$('#cn-*').hide();
Couldn’t there be a class for all these same fields? Example:
CNs
, it would be easier to manipulate with just$('.CNs').hide()
– Marcelo de Andrade
I think I would give @Marcelodeandrade, but I would have to refactor a lot. Anyway would be a great way out, thanks.
– Raylan Soares