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

  • Home
  • SEARCH
  • 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 6827253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:14:39+00:00 2026-05-26T22:14:39+00:00

I have a JQueryMobile button inserted inside the ListView. When the button is hard-coded

  • 0

I have a JQueryMobile button inserted inside the ListView. When the button is hard-coded the css styling of the jquerymobile applies. But when I tried to insert a button programmatically the style was lost. How can I reapply the JQueryMobile’s css to the button?

to give everyone any idea what I am talking about, this is my code to insert item on the ListView

//CODE TO ADD A JAVASCRIPT BUTTON TO THE LIST
var parent = document.getElementById("group-1");
var listItem;
listItem = document.createElement('li');
listItem.setAttribute('id',"group-1-row-0");
var inner=    "<a href=\"#\" style=\"padding-top:0px;padding-left:0px;padding-bottom:0px\">";
inner = inner + "<div class=\"customTableLayout\">";
inner = inner +       "<fieldset data-role=\"fieldcontain\" id=\"ui-softbutton\">";
inner = inner +            "<input type=\"button\" id=\"ui-softbutton\" value=\"SOFTCODED\" />";
inner = inner +       "</fieldset>";
inner = inner + "</div>";
inner = inner + "</a>";
listItem.innerHTML = inner;
parent.appendChild(listItem);

//WHEN YOU TRY TO ENABLE THIS CODE, THE DISPLAY BECOMES WEIRD
//$("#ui-softbutton").button();
//$("#ui-softbutton").button('refresh');

$(parent).listview("refresh");

to VIEW the result of this code and to see that the HARDCODED button works please see this JFiddle

  • 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-26T22:14:40+00:00Added an answer on May 26, 2026 at 10:14 pm

    Live Example:

    • http://jsfiddle.net/bYQFH/5/

    Just needed to append the trigger(‘create’) method

    $(parent).listview("refresh").trigger('create');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Jquery Mobile page. In my header I have a button to
I have a jqueryMobile app that uses google maps api and is working properly
I have a jQueryMobile site/app where performance is an issue. I am reading a
I have the following jQueryMobile page anatomy at index.html: <div data-role=page> <div data-role=header>...</div> <div
I have a PhoneGap 1.4.1 / jQueryMobile 1.0.1 / Android project which is showing
I have just started getting a very strange error when using jQueryMobile for my
Im using jquerymobile together with codeigniter framework and I'm having a problem I have
I am new to jQueryMobile. I have one problem regarding fixed headers. I have
i have an app in Blackberry, I was Build in using Jquery Mobile, but
I have an button in my Jquery mobile page, which is using asp.net webform.

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.