javascript - Showing all divs/elements under parent -


i have javascript function hides divs (and of elements within). after, "show" javascript function called want show 1 section of page , children divs under it.

for example, have:

<div id="synchronize" style="display:none;">   <ul class="bxslider">     <li>       <h4>header</h4>       <p>text</p>       <p>more text.</p>     </li>     <li>hello     </li>   </ul> </div> 

when bxslider used, there several more divs added mix once javascript called.

here javascript:

var theid="synchronize"; //(this value passed in) div = document.getelementbyid(theid); div.style.display = 'block';  $('div#synchronize').children('div').each(function () {   alert(this.value); }); 

the alert giving "undefined". seems should easy, can't figure out.

thanks in advance.

.value refer form field element, not dom element. may want this.innerhtml/this.innertext or kin, or jquery $(this).text()


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -