Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: FAQ code issues

  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FAQ code issues

    Hi, Im trying to create an FAQ. I have this code which works. I have worked out how to change the font/colour eetc of the link you click on to reveal and hide the text, but I cant work out how to
    1. change the font, size etc of the revealling text.
    2. Include a text link in the revealing text.

    If anyone could help me that would be amazing, I'm new to this and have spent ages trying to figure it out!

    Thanks

    code:
    Code:
    <a><font><font><html>
    <head>
    <script type="text/javascript">
    function toggle(obj) {
    var obj=document.getElementById(obj);
    if (obj.style.display == "block") obj.style.display = "none";
    else obj.style.display = "block";
    }
    </script>
    </head>
    <body>
    <a href="javascript: void(0);" onClick="toggle('q1')"<p>
    <font color="#000000"; face="helvetica"; font size="3">Question1</a>
      <div id="q1" 
      <div id="q2" style=>The answer</div>
    </body>
    <br>
    <head>
    <script type="text/javascript">
    function toggle(obj) {
    var obj=document.getElementById(obj);
    if (obj.style.display == "block") obj.style.display = "none";
    else obj.style.display = "block";
    }
    </script>
    </head>
    <body>
    <a href="javascript: void(0);" onClick="toggle('q2')">Question 1</a>
    <div id="q2" style=>The answer</div>
    </body>
      <br>
    <head>
    <script type="text/javascript">
    function toggle(obj) {
    var obj=document.getElementById(obj);
    if (obj.style.display == "block") obj.style.display = "none";
    else obj.style.display = "block";
    }
    </script>
    </head>
    <body>
    <a href="javascript: void(0);" onClick="toggle('q3')">Question 1</a>
    <div id="q3" style="display:none;">The answer</div>
    </body>
      <br>
    <head>
    <script type="text/javascript">
    function toggle(obj) {
    var obj=document.getElementById(obj);
    if (obj.style.display == "block") obj.style.display = "none";
    else obj.style.display = "block";
    }
    </script>
    </head>
    <body>
    <a href="javascript: void(0);" onClick="toggle('q3')">Question 1</a>
    <div id="q3" style="display:none;">The answer</div>
    </body>
      <br>
    <head>
    <script type="text/javascript">
    function toggle(obj) {
    var obj=document.getElementById(obj);
    if (obj.style.display == "block") obj.style.display = "none";
    else obj.style.display = "block";
    }
    </script>
    </head>
    <body>
    <a href="javascript: void(0);" onClick="toggle('q2')">Question 1</a>
    <div id="q2" style="display:none;">The answer</div>
    </body>
    </html></br></br></br></br></font></font></font></a>

  • #2
    New to the CF scene
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    anyone?
    I'm sure its something relatively simple..
    Last edited by phqsteele; 05-29-2012 at 06:15 PM.

  • #3
    Regular Coder
    Join Date
    Aug 2005
    Location
    MS
    Posts
    836
    Thanks
    10
    Thanked 79 Times in 77 Posts
    Try validating and correcting your code first. Not sure why you have multiple body tags, etc..

    Validating:

    Why Validate?: http://validator.w3.org/docs/why.html
    CSS Validator: http://jigsaw.w3.org/css-validator/
    HTML Validator: http://validator.w3.org/#validate_by_uri+with_options
    ☠ ☠RON☠ ☠


  •  

    Posting Permissions

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