CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Hide a tag?

  1. #1
    Join Date
    Sep 2008
    Posts
    4

    Hide a tag?

    I am not really sure it is ajax related but I think it is so.

    I need a very simple code that will hide tag when I push the related button.

    for example pressing "button red" will hide all the rows of the table that their background is defined as red or all the texts that are under a "red" tag (<red></red>). when another click will make them appear again.
    the same will happen with the blue, green etc...

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Hide a tag?

    That would be JavaScript, not AJAX.

    You can hide and show HTML elements by simply changing their style attribute.

    Code:
    function toggle(obj) {
      obj.style.display = (obj.style.display == '') ? 'block' : '';
    }
    Another concern...Using your own tag named <red> would cause HTML validation errors. Why don't you just use a class or some other attibute of the <tr>?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    May 2002
    Posts
    10,943

    Re: Hide a tag?

    [ moved ]
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured