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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:35:04+00:00 2026-06-02T07:35:04+00:00

I have a set of links with custom HTML5 data attributes like this one:

  • 0

I have a set of links with custom HTML5 data attributes like this one: data-test="justExample"

<a href="#" data-test="somethingSpecial">
    This should output "Something Special"
</a>

I want to return this value as "Just Example" instead of “justExample".

Feel free to edit this jsfiddle I created.

  • 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-02T07:35:05+00:00Added an answer on June 2, 2026 at 7:35 am
    $('a').click(function() {
        var str = $(this).data('test'); // get the concated string
        var arr = str.split(""); // Convert the string to array
        for (var i = arr.length - 1; i >= 0; i--) {  // iterate over the characters 
            if (arr[i].match(/[A-Z]/))  // if the char is uppercase
                arr.splice(i, 0, " "); // add a space before it
        }
    
        arr[0] = arr[0].toUpperCase();    // upper the first char.
        var splitedString = arr.join(""); // convert the array to string
        alert(splitedString); // alert the string.
    });​
    

    LIVE DEMO

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

Sidebar

Related Questions

my issue lokks similar to this one: (link) but i have one-to-many association: <set
I have the following lines in my ~/.emacs.d/init.el (custom-set-variables '(flymake-allowed-file-name-masks (quote ( (\\.cc\\' flymake-simple-make-init)
It is common to have a set of links in a footer represented in
In my main CSS file, I have my a:link selector set to display links
I have set up a demo on this page : http://permanaj.net/jqgrid/index.html code: <html> <head>
In a dialog describing my change log, I'd like to have some links to
I have a webpage which has tab list, the HTML looks like this for
Really banging my head with this. I am using isotope http://isotope.metafizzy.co/custom-layout-modes/centered-masonry.html . I have
I have a site where I need to check all href-links if they are
I have this application that uses custom methods to register and loggin users using

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.