javascript - How do I apply style for parent div and their hidden child div also? -
the application more of single page navigation div manipulation. based on previous/next button display section accordingly. now, have generate preview page filled form data. thought clone divs , replace input fields read-only. here div structure cloned already.
solution looking for : enable each div style display "inline-block"
code tried:
function confirmationpage() { //1 $(".pgepreview").closest('div').children().css('display', 'inline-block'); //2 $("#pgepreview div").each(function (e) { if (e != 0) { $(this).css('display', 'inline-block'); } }); }
thanks help.
$("#parent div").each(function (e) { if (e != 0) { $(this).css('display', 'inline-block'); } });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="parent"> <div> <div style="display:none; border: 1px solid; width:100px; height:100px"></div> <div style="display:none; border: 1px solid; width:100px; height:100px"></div> <div style="display:none; border: 1px solid; width:100px; height:100px"></div> <div style="display:none; border: 1px solid; width:100px; height:100px"></div> <div style="display:none; border: 1px solid; width:100px; height:100px"></div> </div> </div>
Comments
Post a Comment