Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • 2
    You are stuck with it. Jquery has an easier way Commented Jan 21, 2019 at 12:05
  • 4
    Possible duplicate of Use of document.getElementById in JavaScript Commented Jan 21, 2019 at 12:07
  • 2
    Use a code editor with auto complete, also helps prevent mistakes in your code if typing isn't your thing. Commented Jan 21, 2019 at 12:11
  • 1
    This is the Javascript for you! This is how it is. You may try other libraries built on top of the JS like jQuery or Lodash or something which might have a method shorter than the one you've mentioned. Commented Jan 21, 2019 at 12:12
  • 2
    @Sujit - More accurately, this is the DOM for you. getElementById isn't JavaScript method. Commented Jan 21, 2019 at 12:13