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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:38:05+00:00 2026-05-18T06:38:05+00:00

I noticed that you can call submit() in event handlers of form elements. For

  • 0

I noticed that you can call submit() in event handlers of form elements. For example,

<input id="myInput" type="button" onclick="submit()" value="Test" />

clicking the button generated by the code above will submit the form. The funny thing is, I can’t call submit() outside the event handler. There is no submit member defined for the input element.(document.getElementById("myInput").submit is undefined.) So, where is this function defined, and where can I find a reference to this function?

  • 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-18T06:38:05+00:00Added an answer on May 18, 2026 at 6:38 am

    It is described here in section 19.1.6:

    Event handlers defined as HTML attributes have a more complex scope chain (…)

    and

    The scope chain of an event handler does not stop with the object that defines the handler: it proceeds up the containment hierarchy. For the onclick event handler described earlier, the scope chain begins with the call object of the handler function. Then it proceeds to the Button object, as we’ve discussed. After that, it continues up the HTML element containment hierarchy and includes, at a minimum, the HTML <form> element that contains the button and the Document object that contains the form. The precise composition of the scope chain has never been standardized and is implementation-dependent. Netscape 6 and Mozilla include all containing objects (even things such as <div> tags), while IE 6 sticks to a more minimal set that includes the target element, plus the containing Form object (if any) and the Document object. Regardless of the browser, the final object in the scope chain is the Window object, as it always is in client-side JavaScript.

    So I guess it was already clear that the submit function is the one of the form. And if the event handler is defined via an HTML attribute, then the scope chain are the element itself and its parents. But it is not standardized, so one should not rely on that behavior.

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

Sidebar

Related Questions

I was looking at some Django examples and I've noticed that you can call
I noticed the other day that I can call boolean.class, but not integer.class (or
I noticed that you can call Queue.Synchronize to get a thread-safe queue object, but
I noticed that I can't combine --traditional options with the other one letter other
I noticed that you can't throw an exception in a destructor. So my question
I've noticed that you can use python libdiff to output a side by side
I'm new to RubyAmf. I noticed that you can send an object with RubyAmf
Is there a way to convert HTML into XAML? I noticed that you can
I noticed today that I can't use * to pass width or precision arguments
I've noticed that nowhere I can find can give me a definitive answer to

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.