You are here:   Home
Register   |  Login

Captured Technology - Blog

Minimize

Collapsing and Expanding HTML Code

Apr 1

Written by:
4/1/2009 1:59 PM  RssIcon

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>

Tags:
Categories:

16 comment(s) so far...


Gravatar

Re: Collapsing and Expanding HTML Code

This is a very good solution for older systems that are written in html and/or asp classic.

By 2009 Taxes on   4/1/2009 10:00 PM
Gravatar

Re: Collapsing and Expanding HTML Code

very good and usefull, thanks for posting!

By last ned filmer on   4/2/2009 9:12 AM
Gravatar

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

By free css templates on   4/4/2009 10:47 AM
Gravatar

Re: Collapsing and Expanding HTML Code

Looks like a pretty good method to create a collapsing area on a page.

By Free TShirts on   4/4/2009 9:14 PM
Gravatar

Re: Collapsing and Expanding HTML Code

I enjoyed reading this review from you

By masenchipz on   4/7/2009 9:17 PM
Gravatar

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.

By pharmaceutical recruitment on   4/8/2009 6:19 AM
Gravatar

Re: Collapsing and Expanding HTML Code

good post thanks for sharing

By windows on   4/11/2009 6:35 AM
Gravatar

Re: Collapsing and Expanding HTML Code

Looks very good method... Thanks for updating posts like this..

By Web Hosting Tool on   4/15/2009 3:35 AM
Gravatar

Re: Collapsing and Expanding HTML Code

This is very useful for expanding HTML and also saves time too...

By Rakesh on   4/16/2009 4:34 AM
Gravatar

Re: Collapsing and Expanding HTML Code

This is very good method to use expanding HTML instead of regular HTML.
Thanks for sharing.

jsmith

By jsmith on   4/25/2009 7:37 AM
Gravatar

Re: Collapsing and Expanding HTML Code

Nice post.........
Looks very good trick use to minimize typing and also time too.

Stalaa

By stalaa on   4/25/2009 7:43 AM
Gravatar

Re: Collapsing and Expanding HTML Code

great post :) helped me alot :) thnx bro :)

steal-ideas !

By srivathsan GK on   4/27/2009 1:39 AM
Gravatar

Re: Collapsing and Expanding HTML Code

like this methid, very intresting way of thinking:) great work:)

By film på nett on   7/30/2009 5:27 PM
Gravatar

Re: Collapsing and Expanding HTML Code

This is very good method to use expanding HTML instead of regular HTML.
Thanks for sharing.

emo hair

By emo hair on   8/13/2009 1:49 AM
Gravatar

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.

By early signs of autism on   12/24/2009 6:53 PM
Gravatar

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!

By basement flooring on   12/24/2009 6:53 PM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 

FaceBook

Minimize

Mobile Version

Minimize
Add CapturedTech - Technology Mippin widget

Translate

Minimize

Sponsors

Minimize

Recent Comments

Minimize
Re: Three Benefits to Using a Royalty-Free Image on Your Website or Blog
Don't pay for royalty free images. They are free after all! I offer links to 96 websites that have tens of thousands (maybe even hundreds of thousands) of absolutely free images, including ones for commercial use! All you need to do is subscribe to my blog at www.davesinternetmarketing.info/royalty-free-images-free-for-commercial-use/
Re: Buzzom Offers Featured User Options
This is when discovered this great new way to grow your follow list. You can pay between $10 and $100 for the number of times you want to app ar at the top of the list.
Re: Microsoft Test Bounties
I had spent a good deal of my time looking for someone to explain this subject clearly and I have really enjoyed reading your blog posts and I collected a lot of interesting things as well as I done a research on the subject and learn most peoples will agree with your blog.
Re: 10 Ways to Source Great Sales Leads
Hoovers.com, that have contact information for tens of millions of businesses. If necessary, you can work with these companies' research teams to order lists specifically tailored to your organization's sales needs.
Re: Microsoft Test Bounties
To find bugs and showing it to microsoft is quite admirable. Keep blogging more i will appreciate.

u comment, i follow