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 8713471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:21:06+00:00 2026-06-13T05:21:06+00:00

No JQuery. I am trying to create a radio button followed by text with

  • 0

No JQuery. I am trying to create a radio button followed by text with javascript. It is printing out everything after the document.writes. I think I have a problem with the quotes, but I can’t fix it. Can someone help me fix this?

function printarray (newarray, cnt) { 
  if (cnt < 2) { 
        document.getElementById('radio').style.display = 'none'; 
  } else { 
    for (var i = 0; i < newarray.length; i++) { 
      var cur_text = newarray[i]; 
      if (i == 0) { 
        var radio = '<input type="radio" name="bank" value="KeyBank" onclick="showChoice(this)">' + 'KeyBank'; 
      } else { 
        radio = radio + '<input type="radio" name="bank" value="<script>document.write(cur_text);</script>" onclick="showChoice(this)">' + "<script>document.write(cur_text)</script>;"; 
      } 
    } 
    document.getElementById('btn').style.display = 'none'; 
    var foo = document.getElementById('radio').innerHTML = radio; 
  } 
  document.getElementById('array').innerHTML = cnt; 
} 
  • 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-13T05:21:07+00:00Added an answer on June 13, 2026 at 5:21 am

    First issue is, below line is wrong,

    radio = radio + '<input type="radio" name="bank" value="<script>document.write(cur_text);</script>" onclick="showChoice(this)">' + "<script>document.write(cur_text)</script>;";
    

    Corrected line,

    radio = radio + '<input type="radio" name="bank" value="'+cur_text+'" onclick="showChoice(this)">' + cur_text;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Text blinking jQuery I'm trying to create a timer in my HTML5/JavaScript
I am learning JQuery and trying to create cycling text through images but I
I'm trying to create a Hide/Show button with jQuery. When .cminus is clicked, it
I'm trying to create a small slider where jquery UI Scale brings out and
Not much good in jQuery/javascript but trying to create a small game. here is
Hi I am relatively new to javascript and jQuery and while trying to create
Im trying to create a game with jQuery, but none of the options after
I am trying to create a jQuery UI button with a custom icon on
I am trying to create a jQuery mobile link or button which will navigate
I'm trying to create a game of memory using Javascript/jQuery. Basically, a random array

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.