Thursday, 15 May 2014

html - How can I swap in and out text inside a DIV using only javascript? -



html - How can I swap in and out text inside a DIV using only javascript? -

i have text within div this:

<div> @*<p class="header">xxx</p> <p> yyy </p> <p> yyy </p>*@ <p class="header">xxx</p> <p> yyy </p> <p> yyy </p> </div>

i commented out first 3 paragraphs , replaced them sec three. there way create every 10 seconds changes between showing first 3 paragraphs , sec three. note don't utilize jquery on page. want find solution not utilize jquery.

without jquery:

put 2 groups of

in 2 div id.

document.getelementbyid('iddiv1').style.display = "none"; --> create invisibile div1 document.getelementbyid('iddiv2').style.display = "block"; --> create visibile div2

for create in automatic mode, have utilize timer function of javascript, here. link of w3school.

javascript html css

No comments:

Post a Comment