Jump to content

need help with js code


dezkit

Recommended Posts

What about

<div onclick="document.getElementById('below').style.display = 'block'; ">This is some text. Click here to show more text.</div><div id="below" style="display:none; ">This is some more text. You cannot see it on page load, click the text above to display it.</div>

But you need to be more clear on what you mean by "and it changes".

Link to comment
Share on other sites

  • 2 months later...

What about

<script type="text/javascript">function change(ele) {element = document.getElementById(ele);(element.style.display == "block") ? element.style.display = "none" : element.style.display = "block";}</script><div onclick="change('below')">This is some text. Click here to show more text.</div><div id="below" style="display:none; ">This is some more text. You cannot see it on page load, click the text above to display it.</div>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...