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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:35:05+00:00 2026-05-26T07:35:05+00:00

I have this so far: http://jsfiddle.net/26eVE/4/ I want that when the user clicks on

  • 0

I have this so far: http://jsfiddle.net/26eVE/4/

I want that when the user clicks on the small input field (that one with value 1 as default), the value changes from 1 to “”.

EDIT: Also after the focus is not on the input (the user clicks somewhere else after clicking in the input), show the default value 1 if the user didn’t type anything inside the text input, otherwise keep the input he typed in.

  • 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-26T07:35:05+00:00Added an answer on May 26, 2026 at 7:35 am

    You have a bug in your html, you’re missing the = in the class attribute.

     <input type="text" value="1" class="item_input" /> 
    

    Something like this is all you need.

        // Remove and store on focus
        // Restore if empty on blur 
        $('.item_input')
                .focus(function(e) { 
                        var $this = $(this);
                        $this.data('lastValue', $this.val()).val(''); 
                })
                .blur(function(e) { 
                        var $this = $(this);
                        if($this.val()=='') $this.val($this.data('lastValue')); 
                });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this so far: http://jsfiddle.net/u5vhS/54/ . What I want to be able to
This is my code so far: http://jsfiddle.net/zY3xx/ I have a blank option in all
This is what I have so far: http://jsfiddle.net/xzTGv/21/ I really need an improvement with
This is what I have so far: http://jsfiddle.net/beCVL/5/ This is how I'm trying to
Here is what i have so far: http://jsfiddle.net/BgEtE/ I am trying to get something
Ok, if you go here: http://jsfiddle.net/RarFB/2/ You will see the work that I have
I have table like this -> http://jsfiddle.net/jurisKaste/FvgeQ/ And I need to get array of
Here's what I have so far: http://jsfiddle.net/nxCFn/ var il = new ImageLoader(); function ImageLoader()
I have this fiddle: http://jsfiddle.net/tatygrassini/tZBXe/ Horizontal dropdown menu with a 1 level deep submenu.
Here is what I have so far: http://jsfiddle.net/6j4cT/3/ Sorry for not pasting the code

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.