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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:52:12+00:00 2026-05-30T18:52:12+00:00

Hello I am new to Jquery i am using pure javascript till now.Now i

  • 0

Hello I am new to Jquery i am using pure javascript till now.Now i am trying jquery .

HTML

<input id="scriptBox" type="text" onkeypress="return test(event)" />

Javascript

function test(e) {
    if (e.keyCode == 13) {
        var tb = document.getElementById("scriptBox");
        eval(tb.value);
        return false;
    }
}

How to do this in jquery.

  • 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-30T18:52:13+00:00Added an answer on May 30, 2026 at 6:52 pm

    Beware of using eval, but here’s how to write your code in jQuery:

    $('#scriptBox').keypress(function(e) {
       if(e.keyCode == 13) {
          eval($('#scriptBox').val());
          return false;
       }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a new HTML element using jQuery. var v=jQuery('<p>Hello</p>); But when I try
hello friends i m new to jQuery and nyro modal. right now i m
hello im trying to make something like github treeslider im new to javascript.. but
Hello I'm new to ontologies, my assignment is to create an ontology using Protege
When using an importjs() type of function (see below for an example), jQuery doesn't
I am new to jquery mobile framework. I implemented the sample application using jquery
I am using jQuery and creating now search. And i want to change all
Hello the problem i'm experiencing is when I attempt to call javascript function. Using
Hello all im trying to make this slide effect http://tinyurl.com/628z32d but im new to
am new to jquery.I am doing some ajax using jquery in django. $(document).ready(function() {

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.