SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,658
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    show/hide a span

    I have a combo box (So I can choose either yes or no) If I choose yes, how do I show a <span> with an id (change is from display:none, to display:block)

    Thank you!
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by lukeurtnowski View Post
    I have a combo box (So I can choose either yes or no) If I choose yes, how do I show a <span> with an id (change is from display:none, to display:block)
    You would use an onchange event on the combo box, to trigger a function that checks the selected value, and sets or removes a class name from the span. Commonly the class name is "hidden" so that the presentation is controlled from a CSS rule.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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