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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:18:33+00:00 2026-05-25T20:18:33+00:00

Have a slight problem with this code : jQuery.fn.markCursor = function(e){ $(this).focus(); $(this).keyup(function(e) {

  • 0

Have a slight problem with this code :

jQuery.fn.markCursor = function(e){
    $(this).focus();
   $(this).keyup(function(e) {
  $cursorStart.enterText(e);

});

};

jQuery.fn.enterText = function(e){

if (e.keyCode == 9){
    $cursor.val("");
    alert("hello");
}

};

The tab key is resorting to its default behavior in the browser, would .preventdefault help here? How would I add 12 spaces without the code taking up 12 lines in jquery :p

  • 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-25T20:18:34+00:00Added an answer on May 25, 2026 at 8:18 pm

    e.preventDefault() would help. If you want to add twelfe spaces without literally typing them, use Array(12).join(" ");. Surely, typing twelfe spaces may be easier.

    Some methods to type twelfe spaces:

    var s=[];s.length=12;s.join(" ");
    var s=Array(12).join(" ");
    var s="            "; //Shortest so far.
    

    As you can see, using Array(i).join(" ") starts being useful when i is higher than 17. Note that the this approach enables a dynamic indenting feature.

    EDIT
    Quick tuturial on key events:

    • keydown – Initiated when the key is pressed down. This event is fired once, before any default event has occured
    • keypress – This event is fired (multiple times) while the key is pressed down, before a default event has occured.
    • keyup – Fired after the key has been released (which happens only once per set of key events). Needless to say, all of the default events have already been occured.

    keydown and keypress can be used to capture and cancel key events. If you want to catch and validate all key events, use keypress. If you’ve assigned multiple events (eg to window and to input), you may also use e.stopPropagation() in conjunction with e.preventDefault(). The first function stops the event from bubbling further (=the event isn’t passed to other event listeners any more). The second function prevents the default behaviour from occuring.

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

Sidebar

Related Questions

I've wrote this simple piece of code. And I have a slight problem with
I have a slight problem with this code: string[] sWords = {Word 1, Word2}
am new here. i have a slight problem; PLease look at the following code
hey everyone, here is the site SEE BELOW I have a slight jquery problem
I have a slight javascript problem, and this is the reason to why i
I'm having a slight problem. I have set my <input type=file> to onChange=this.form.submit() .
I am having a slight problem with this piece of code as I am
I have a slight problem with a path: D:\\Music\\DJ Ti%C3%ABsto\\Tiesto\\Adagio For Strings (Spirit of
I have a slight problem... we made a change to our url structure the
I have a slight problem, I am trying to capture the input of two

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.