Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9142297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:45:31+00:00 2026-06-17T09:45:31+00:00

I have a challenge to use existing JavaScript with my HTML. My HTML are

  • 0

I have a challenge to use existing JavaScript with my HTML. My HTML are two radiobuttons and the element ‘textarea’. When one radiobutton is selected (button: No) the textarea has to be shown and when the other (button: Yes) is selected it has to be hidden.

<span><input type="radio" name="feedback" id="Yes" value="Yes"><label for="Yes">Yes</label></span>
<span><input type="radio" name="feedback" id="No" value="No"><label for="No">No</label></span>

<div class="">
  <h5>lorem ipsum da lore</h5>
  <textarea>Lorem ipsum da lore</textarea>
</div>

The following JavaScript I have to use to accomplish the desired effect. I am Fairly new to JavaScript, so I hope somebody can explain what the best way is with the JavaScript code hereafter:

    $("input.kpn-bh-hideShow").change(function(){
    var id1 = $(this).attr('class').split(' ')[1];
    var id2 = $(this).attr('class').split(' ')[2];

    if(id1 && id2){
        $('#' + id1)
            .hide()
            .find('input, select')
            .attr("disabled","disabled");

        $('#' + id2)
            .show()
            .find('input, select')
            .filter(":visible")
            .removeAttr("disabled");
    }else{
        $('#' + id1)
            .hide()
            .find('input, select')
            .attr("disabled","disabled");
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:45:32+00:00Added an answer on June 17, 2026 at 9:45 am
        **check out this code for this ** 
        <form name="f">
         <input type="radio" id="a" name="a"/>
         <input type="radio" id="b" name="a" />
         <textarea>here is a textarea</textarea>
    
        </form>
    <script type="text/javascript">
    //A link for the jquery library must be added here
    $("#a").onclick(function (){
    $("textarea").css("display","none");
    
    });
    $("#b").onclick(function (){
    $("textarea").css("display","block");
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

learning Jquery and integrating with PHP - getting there, but have one last challenge
One challenge using hibernate is that manged classes have to have a default constructor
I have a challenge that I am trying to solve and I can't work
I have a challenge in front of me. Let me present the challenge which
Challenge: I have this code that fails to compile. Can you figure out what's
I have a simple challenge with a background not animating. I have used this
I'm currently trying to dig deep into python and I have found a challenge
I have a pretty basic challenge-based iPhone game, and I wanted to know what
I have been set a challenge to create an indexer that takes all words
I have a bit of a unique challenge today. I have a client that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.