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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:45:58+00:00 2026-06-13T22:45:58+00:00

I am manipulating the data-complete-text attribute of a link using jQuery. My code looks

  • 0

I am manipulating the data-complete-text attribute of a link using jQuery. My code looks like this.

var complete =  _self.attr("data-complete-text");

_self.attr("data-complete-text","<span class='symbol-done-tick'></span><span class='acheived-text'>"+complete+"</span>");

That is I am assigning html spans to this attribute to get the desired effect and it works fine. I mean, the spans get inserted properly but the CSS classes which I have specified in these spans don’t have any effect. I dunno why. Help me out.

  • 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-13T22:46:00+00:00Added an answer on June 13, 2026 at 10:46 pm

    If you’re trying to set the data-complete-text so that Bootstrap’s Button will use it, after setting the data-complete-text attribute you have to set the state of the button as well:

    _self.button('complete');
    

    The documentation (such as it is) doesn’t say it supports HTML there, but it seems to work in my test: Live Example | Source

    HTML:

    <button id="target" type="button" class="btn btn-primary" data-loading-text="Loading...">Original Text</button>
    

    JavaScript:

    jQuery(function($) {
    
      // Get the button
      var _self = $("#target");
    
      // Set the attribute
      _self.attr("data-complete-text",
                 "<span class='foo'>Complete</span>");
    
      // Wait for click
      _self.one("click", function() {
    
        _self.button('complete');
      });
    
    });
    

    In the above, the foo class on the span inside the data-complete-text works when you set the button state to 'complete'.

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

Sidebar

Related Questions

which one should be used to manipulating data, Array or Array Object? Like search,sort
I tried manipulating fb_button_text value using jQuery but, it didn't work at all. Then
I'm having a problem with using stdio commands for manipulating data in a file.
Probably a dumb question, but does MSIL have general Forth-like functions for manipulating data
I have table and JQuery dialog for manipulating data. I want to change backgroun
I have an EF code-first generated database. Data manipulation is done using DbContext .
When manipulating data using Linq, how often does the SubmitChanges() method have to be
I feel like a complete tool for posting this, it is so basic and
I'm manipulating few data with PHP, I have the choice between Json and XML.
I am a web developer so my knowledge of manipulating mass data is lacking.

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.