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"

enter image description here

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

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -