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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:10:20+00:00 2026-06-10T15:10:20+00:00

I am using a form and a reset button where I can reset all

  • 0

I am using a form and a reset button where I can reset all the entered values but it is not working at all.

When I debugged with the Firefox console tab, I saw an error illegal character at the end of the jQuery script. Can someone tell me what is the wrong part here?

<!DOCTYPE HTML>
<html lang="en-IN">
<head>
  <meta charset="UTF-8">
  <title></title>
  <script type="text/javascript" src="js/jquery1.7.2.js"></script>
</head>
<body>
  <script type="text/javascript">
    jQuery('#reset').click(function(){
        $(':input','#myform')
        .not(':button, :submit, :reset, :hidden')
        .val('')
        .removeAttr('checked')
        .removeAttr('selected');
    });​
</script>
<form id='myform'>
  <input type='text' value='test' />
    <select>
      <option>One</option>
      <option selected="true">Two</option>
    </select>
    <select multiple="true" size="5">
      <option>One</option>
      <option selected="true">Two</option>
    </select>
    <input type='button' id='reset' value='reset' />
</form>​
</body>
</html>
  • 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-10T15:10:21+00:00Added an answer on June 10, 2026 at 3:10 pm

    Try the following:

    $(function() {
        $('#reset').click(function() {
            $(':input','#myform')
                .not(':button, :submit, :reset, :hidden')
                .val('')
                .removeAttr('checked')
                .removeAttr('selected');
        });
    });
    

    You’re running the javascript before the DOM is ready. $(function() {}) only runs when the DOM is ready. Read more here: .ready()

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

Sidebar

Related Questions

i am using form authentication for my website which is written in ASP.Net, but
Don't know why this is happening, but after submitting a form via JS (using
We all know the good old disable the submit button trick but what are
I am using form base authentication in my Sharepoint site. On my login page
Code to create new form instance of a closed form using form name I
I see lots of apps using Form objects to validate data and then passing
Ordinarily, using form_for(@foo) means that on the back end of the form's action, you'll
I would like to have Ajax form in Rails so i'm using form_remote_tag. The
I am trying to create a custom authentication scheme in ASP.NET MVC using form
Using a form I am inserting the information from 3 text fields and 2

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.