Using codeigniter 3.x
i'm trying to get data from database using foreach loop.
<h3 style="margin-right:15px;" id='hideshow'>August 2016</h3>
<?php foreach($duxeos as $e): ?>
<div class='content' ><h4 class="dropdate"><?php echo $e->fulldate;?></h4><div class="cdropdate" class="defhide"><?php echo $e->content;?></div></div>
<?php endforeach; ?>
javascript :
jQuery(document).ready(function(){
jQuery('.hideshow').live('click', function(event) {
jQuery('.content').toggle('show');
});
});
jQuery(document).ready(function(){
jQuery('.dropdate').live('click', function(event) {
jQuery('.cdropdate').toggle('show');
});
});
now it's working, but when i press the hide button, it hide all content, how can i hide content that i want ?
loopin your code.. Also not that, There must not be multipleelementsin adocumentthat have the sameidvalue.foreach($data as $e)is foreach loopclassinstead ofid, it will make your life easy..