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
Post a Comment