CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009

    Exclamation a little confused

    hey everyone iam fairly new to javascript and struggling a little and i have a few questions
    below is my code and iam trying to make a site that when you click on the check box the desired paragraph will appear maybe everyone can assist me with this?

  2. #2
    Join Date
    Dec 2009

    Re: a little confused

    here is meh code

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
    <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>

    <title> PROJECT 6-- OBJECTIVE</title>
    <meta http-equiv='Content-Type' content='text/html; charset= utf-8' />

    <style type="text/css">

    h2 {text-align:center}
    h3 {text-align:center}

    body {background-color:#cccccc;}


    COP 1830 -
    Written by:
    Last revised:

    <h2>JavaScript Objects Project</h2>


    <div style="text-align:center ;border:1px solid red">


    <input type="checkbox" name="objective" value=objective" /> Objective

    <input type="checkbox" name="details" value="details" /> details

    <input type="checkbox" name="submissions" value="submissions" /> submissions


    <script type="text/javascript">

    if (obj = true


  3. #3
    Join Date
    Jul 2005
    Currently in Mexico City

    Re: a little confused

    1. When posting code please USE CODE TAGS
    2. This is Java forum. JavaScript has nothing to do with Java (except certain naming/syntax similarities). JavaScript forums are here: http://www.codeguru.com/forum/forumdisplay.php?f=8

    3. Here's the answer:
    <script type="text/javascript">
    function showText(checkBox){
    		document.getElementById(checkBox.value).style.display = "block";
    		document.getElementById(checkBox.value).style.display = "none";
    <input type="checkbox" name="objective" value="objective" onclick="showText(this);" /> Objective <br />
    <input type="checkbox" name="details" value="details" onclick="showText(this);" /> Details <br />
    <input type="checkbox" name="submissions" value="submissions" onclick="showText(this);" /> Submissions <br />
    <p id="objective" style="display:none;">Objective description text...</p>
    <p id="details" style="display:none;">Details description text...</p>
    <p id="submissions" style="display:none;">Submissions descriptions...</p>
    Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?

    I had a nightmare last night. I was dreaming that Iím 64-bit and my blanket is 32-bit and I couldnít cover myself with it, so Iíve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S (from: bash.org.ru)

    //always looking for job opportunities in AU/NZ/US/CA/Europe :P

    USE [code] TAGS! Read this FAQ if you are new here. If this post was helpful, please rate it!

  4. #4
    Join Date
    May 2009

    Re: a little confused

    Quote Originally Posted by painfull View Post
    iam fairly new to javascript and struggling a little and i have a few questions
    This is the wrong place to ask those questions because Javascript, despite its name, has nothing to do with Java.

Tags for this Thread

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.