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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:38:20+00:00 2026-05-30T04:38:20+00:00

When I use javascript to change the innerhtml of a button, the button looses

  • 0

When I use javascript to change the innerhtml of a button, the button looses the padding above and below the text, but retains the padding on the sides.
This is the code I use:

document.getElementById("NextBtn").innerHTML="Finish";

How can I resolve this?

  • 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-30T04:38:22+00:00Added an answer on May 30, 2026 at 4:38 am

    With jQuery widgets you can normally target the .ui-btn-text element that will be a descendant of the original element. For instance here is the HTML markup for an initialized button widget from the jQuery Mobile framework:

    <a data-role="button" href="#" data-theme="c" id="test-btn" class="ui-btn ui-btn-corner-all ui-shadow ui-btn-up-c">
        <span class="ui-btn-inner ui-btn-corner-all">
            <span class="ui-btn-text">Click Me (0)</span>
        </span>
    </a>
    

    Notice the text is inside the span.ui-btn-text element. Knowing this we can target that element to update the text:

    $('#test-btn').find('.ui-btn-text').text('New Text!');
    

    Here is a demo: http://jsfiddle.net/qp3uF/

    Update

    Since there are several types of buttons you could be talking about, here is how to update the text for each:

    //<a>
    $('a').find('.ui-btn-text').text('New Text');
    
    //<input type="button" /> and <input type="submit" />
    $('input[type="button"], input[type="submit"]').val('New Text').prev('.ui-btn-inner').children('.ui-btn-text').text('New Text');
    
    //<button>
    $('button').prev('.ui-btn-inner').children('.ui-btn-text').text('New Text');
    

    Here is a demo: http://jsfiddle.net/qp3uF/2/

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

Sidebar

Related Questions

I use Javascript to click a link in the webbrowser control. But I don't
I'd like to use JavaScript to calculate the width of a string. Is this
I'm trying to use javascript to change the color of a specific li of
I have this function in my Javascript Code that updates html fields with their
This used to work, but for some reason it doesn't anymore. I use a
When you want to use Javascript to change HTML, how do you know when
I was wondering if its possible to use Javascript to change the function/method that
I've got some XML (valid XHTML) that looks like this: <html> <head> <script type=text/javascript>
I use JavaScript for rendering 20 tables of 100 rows each. The data for
I want to use javascript to insert some elements into the current page. Such

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.