class - jQuery selector id not recognized issue -


    <div class="ground">             <div class="row">                 <div class="box" id="block1">&nbsp;</div>                 <div class="box" id="block2">&nbsp;</div>                 <div class="box" id="block3">&nbsp;</div>                 <div class="box" id="block4">&nbsp;</div>             </div>         </div> 

this html.

$(document).ready(function(){     $('#block1').click(function(){     $(this).slideup();     }); }); 

this script. here, trying make division id thing when clicked. however, simple code won't work.

when put div "block1" id outside div class=ground, works ok. whenever put in inside other tags, selector not recognize id , nothing happens when click it.

to knowledge id should recognized regardless of belongs, isn't it?


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -