Need a small javascript help

Discussion in 'JavaScript' started by Axus Technologies Inc., Aug 16, 2009.

  1. #1
    Hi...
    I have 5 questions and 1 answer to each of the question.

    I just want to list my questions vertically one by one and when someone clicks on any question, the answer directly displays on the right of that question..

    Thats it..
    Please help.. How do I do this ?:rolleyes:
     
    Axus Technologies Inc., Aug 16, 2009 IP
  2. andrewhudson1985

    andrewhudson1985 Peon

    Messages:
    132
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    use javascripts inbuilt events like onclik() event and display answer near the question.
     
    andrewhudson1985, Aug 17, 2009 IP
  3. Mastermaniac

    Mastermaniac Peon

    Messages:
    128
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Actually thats quiet simple.. :)

    First of all add a paragraph
    p
    HTML:
    element after each question and assign a unique ID to it..


    Then add these events on the question..

    
    <p onmouseover="document.getElementById('q1').innerHTML='Answer of this question' onmouseout="document.getElementById('q1').innerHTML=''">Question!</p><p id="q1"></p>
    
    Code (markup):
    Add all the 5 questions like this :)
     
    Mastermaniac, Aug 17, 2009 IP
  4. Axus Technologies Inc.

    Axus Technologies Inc. Peon

    Messages:
    599
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Axus Technologies Inc., Aug 17, 2009 IP
  5. Pudge1

    Pudge1 Well-Known Member

    Messages:
    912
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    Digital Goods:
    1
    #5
    You could use an iframe if you saying what I think you are.
     
    Pudge1, Aug 17, 2009 IP