dezkit Posted September 6, 2007 Share Posted September 6, 2007 Can someone give me a code that when i press a text, underneath the text it shows more text and it changes Link to comment Share on other sites More sharing options...
user4fun Posted September 7, 2007 Share Posted September 7, 2007 make a cearch for onlick functions, check out the tutorials. I am sure it is covered.good luck Link to comment Share on other sites More sharing options...
aspnetguy Posted September 7, 2007 Share Posted September 7, 2007 you are goign to have to be more specific. I don't understand what you want to do. Link to comment Share on other sites More sharing options...
Synook Posted September 7, 2007 Share Posted September 7, 2007 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 More sharing options...
dezkit Posted December 1, 2007 Author Share Posted December 1, 2007 thank you very much synook, but is there a way when u press it again it changes back to This is some text.... Link to comment Share on other sites More sharing options...
Synook Posted December 2, 2007 Share Posted December 2, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.