Subscribe in a reader
Written by: 4/1/2009 1:59 PM
When in need of a quick way to expand and collapse HTML code on the client without posting back to the server of your web application, utilize the <div> tag with a style and some Javascript. Start with the style display set to either none or block and then interchange these two setting based upon a hyperlink click event.
<a href="javascript:;" onmousedown="if(document.getElementById('divMessage_1').style.display == 'none')
{ document.getElementById('divMessage_1').style.display = 'block'; }
else{ document.getElementById('divMessage_1').style.display = 'none'; }">Show/Hide</a>
<div id="divMessage_1" style="display:none">
<p>This is something to show or hide.</p>
</div>
16 comment(s) so far...
Re: Collapsing and Expanding HTML Code This is a very good solution for older systems that are written in html and/or asp classic.
Re: Collapsing and Expanding HTML Code
This is a very good solution for older systems that are written in html and/or asp classic.
Re: Collapsing and Expanding HTML Code very good and usefull, thanks for posting!
very good and usefull, thanks for posting!
Re: Collapsing and Expanding HTML Code Really awesome blog. I enjoyed reading this review from you. I found that you really update your site regularly that made me more interesting. I've bookmarked your site for my future use.Thank you sagar
Really awesome blog. I enjoyed reading this review from you. I found that you really update your site regularly that made me more interesting. I've bookmarked your site for my future use.Thank you sagar
Re: Collapsing and Expanding HTML Code Looks like a pretty good method to create a collapsing area on a page.
Looks like a pretty good method to create a collapsing area on a page.
Re: Collapsing and Expanding HTML Code I enjoyed reading this review from you
I enjoyed reading this review from you
Re: Collapsing and Expanding HTML Code I've used this technique to create tabbed displays on web pages in the past very neat, very handy.
I've used this technique to create tabbed displays on web pages in the past very neat, very handy.
Re: Collapsing and Expanding HTML Code good post thanks for sharing
good post thanks for sharing
Re: Collapsing and Expanding HTML Code Looks very good method... Thanks for updating posts like this..
Looks very good method... Thanks for updating posts like this..
Re: Collapsing and Expanding HTML Code This is very useful for expanding HTML and also saves time too...
This is very useful for expanding HTML and also saves time too...
Re: Collapsing and Expanding HTML Code This is very good method to use expanding HTML instead of regular HTML.Thanks for sharing.jsmith
This is very good method to use expanding HTML instead of regular HTML.Thanks for sharing.jsmith
Re: Collapsing and Expanding HTML Code Nice post.........Looks very good trick use to minimize typing and also time too.Stalaa
Nice post.........Looks very good trick use to minimize typing and also time too.Stalaa
Re: Collapsing and Expanding HTML Code great post :) helped me alot :) thnx bro :)steal-ideas !
great post :) helped me alot :) thnx bro :)steal-ideas !
Re: Collapsing and Expanding HTML Code like this methid, very intresting way of thinking:) great work:)
like this methid, very intresting way of thinking:) great work:)
Re: Collapsing and Expanding HTML Code This is very good method to use expanding HTML instead of regular HTML.Thanks for sharing.emo hair
This is very good method to use expanding HTML instead of regular HTML.Thanks for sharing.emo hair
Re: Collapsing and Expanding HTML Code I hope your style of writing will help me to get my own and be such a great writer as you.
I hope your style of writing will help me to get my own and be such a great writer as you.
Re: Collapsing and Expanding HTML Code Useful, well-explained idea. I'm very grateful for your post! Wish you all the best. Let luck and success be with you! You are worth of it. Your blogs are magnificent. I will come there in some days in hope to see more posts of you!
Useful, well-explained idea. I'm very grateful for your post! Wish you all the best. Let luck and success be with you! You are worth of it. Your blogs are magnificent. I will come there in some days in hope to see more posts of you!