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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:29:14+00:00 2026-05-29T10:29:14+00:00

I am trying to generate a simple jQuery code snippet in JavaScript and append

  • 0

I am trying to generate a simple jQuery code snippet in JavaScript and append it to one of the divs already available in my html file. Here is the string I am trying to append as an html content of the existing div element in my html file:

<form><div id=\"radio\"><input type=\"radio\" id=\"radio1\" name=\"radio\" /><label 
for=\"radio1\">Choice 1</label><input type=\"radio\" id=\"radio2\" name=\"radio\" /><label 
for=\"radio2\">Choice 2</label><input type=\"radio\" id=\"radio3\" name=\"radio\" /><label 
for=\"radio3\">Choice 3</label></div></form>

If you try the following code on JSFiddle:

$('div#new').append('<form><div id=\"radio\"><input type=\"radio\" id=\"radio1\" name=\"radio\" /><label 
for=\"radio1\">Choice 1</label><input type=\"radio\" id=\"radio2\" name=\"radio\" /><label 
for=\"radio2\">Choice 2</label><input type=\"radio\" id=\"radio3\" name=\"radio\" /><label 
for=\"radio3\">Choice 3</label></div></form>')

The Radio elements are displayed but with no jQuery visual style. When trying the same string in a static html file (see below) the visual style appears correctly. Would appreciate your help.

PS: I am trying to avoid jquery\html\JS template so would be great it I could get this code working with no needs of templates.

Thanks,
Jamil

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head>

<body>
    <form>
        <div id="radio">
            <input type="radio" id="radio1" name="radio" />
            <label for="radio1">Choice 1</label>

            <input type="radio" id="radio2" name="radio" />
            <label for="radio2">Choice 2</label>

            <input type="radio" id="radio3" name="radio" />
            <label for="radio3">Choice 3</label>
        </div>
    </form>
</body>
</html>
  • 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-05-29T10:29:15+00:00Added an answer on May 29, 2026 at 10:29 am

    .trigger(‘create’) on the element will force the element to re-render again picking up all necessary styles.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out how to generate a simple join that uses an
I'm trying to send messages generated by Google Protocol Buffer code via a simple
I'm trying to generate customized xml files from a template xml file in python.
I am trying to generate a Sandcastle help file for a website. In the
I am trying to generate equivalent MD5 hashes in both JavaScript and .Net. Not
I'm trying to generate some code at runtime where I put in some boiler-plate
I'm trying to generate a simple static ELF using libelf, but I seem to
Trying to setup a simple Thread/Poll table mapping. Here is what I have: Threads
I'm trying to generate some XML for a jQuery.get (AJAX) call, and I'm getting
I'm trying to use jQuery to identify <td> elements which contain specific HTML comment

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.