As trivial as it sounds, I'm having trouble executing this script, the problem I have is the following, when I enter a page I show a div with a selected content from my bank and this is being done correctly, from then on the user has the option to show this information in a Grid or in a List, I created a radio with two options, Grid and List and I am trying to hide the first div that is shown when entering the page when one of these options is selected. What I've done so far is this:
$(window).load(function(){ $(':radio').change(function (event) { var id = $(this).data('id'); $('#' + id).addClass('none').siblings().removeClass('none'); if ((id == "lista") || (id == "grid")) { document.getElementById('geral').style.display="none"; } }); });
The div's look like this:
<div id="geral">
Geral Mostra ao entrar na página
</div>
<div id="lista" class="none">
Lista, mostra ao selecionar Lista no radio
</div>
<div id="grid" class="none">
Grid, mostra ao selecionar Lista no radio
</div>