The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Checkbox with link which make appear a paragraph in a form

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #44569
    Kevin Mamaqi

    I’m working on a form and I need to do this: [](”) I refer to the checkbox with link, which when clicked open a text paragraph.

    Sorry for the name of the topic but I really don’t know how to call it better.

    Thanks in advance, Kevin.


    You can use jQuery.

    Target the checkbox, and when it is clicked, toggle a css class on the paragraph you want to show/hide.




    Kevin Mamaqi

    Hi hotpink,

    Thanks for your response, but can you be more specific please? I’m not good with Javascript…

    Kevin Mamaqi

    I think I got the important stuff working, but I need to add a page onload and I don’t know how, Can anyone tell me how to do it please?

    Check out this Pen!


    Easiest way is to append this to your JS: `window.onload = ocultartexto;`

    By the way you have a parameter in that function you aren’t using, might as well remove it.

    `if(conformidad.checked==true)` => `if(conformidad.checked)`

    Kevin Mamaqi

    It worked CrocoDillon, thanks.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.