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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:05:38+00:00 2026-05-26T15:05:38+00:00

How can create a mask input for number that have percent by jQuery? Do

  • 0

How can create a mask input for number that have percent by jQuery? Do I make input just accept until three numbers and put percent sign after numbers while user finished typing(keyup)?

I don’t use plugins.

Example:
1% Or 30% Or 99% Or 100% Or 200%

<input name="number" class="num_percent">
  • 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-26T15:05:38+00:00Added an answer on May 26, 2026 at 3:05 pm

    You’re better off not using JavaScript for this. Besides the problems that come with using onkeyup for detecting text input, you also have the hassle of parsing the resulting string back to a number in your client/server scripts. If you want the percent sign to look integrated, you could do something like this:

    <div class="percentInput">
        <input type="text" name="number" class="num_percent">
        <span>%</span>
    </div>
    
    .percentInput { position:relative; }
    .percentInput span { position: absolute; right: 4px; top:2px; }
    .num_percent { text-align: right; padding-right: 12px; }
    

    http://jsfiddle.net/BvVq4/

    I’m rushing slightly, so you may have to tweak the styles to get it to look right cross-browser. At least it gives you the general idea.

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

Sidebar

Related Questions

I have a string on which I try to create a regex mask that
I needed to create a input mask for a jQuery datepicker in my Rails
I can create a contact that is not mail enabled, but how do I
One can create an anonymous object that is initialized through constructor parameters, such as
How can I mask my flash movie dynamically using actionscript to create a 5
I can create an opacity mask in WPF using a LinearGradientBrush as follows <LinearGradientBrush
For example, I would like to create a mask that masks elements with value
How can I create a PNG file if I have two separated JPG files
I can create a menu item in the Windows Explorer context menu by adding
I can create the following and reference it using area[0].states[0] area[0].cities[0] var area =

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.