{"id":23483,"date":"2020-10-01T15:03:28","date_gmt":"2020-10-01T22:03:28","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=23483"},"modified":"2023-12-01T04:01:21","modified_gmt":"2023-12-01T12:01:21","slug":"javascript-document-getelementbyid-is-not-a-function","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/","title":{"rendered":"JavaScript document.getElementByID is not a function Solution"},"content":{"rendered":"\n<p>The JavaScript getElementById method selects an element from the HTML <a href=\"https:\/\/careerkarma.com\/blog\/what-is-javascript\/\">Document Object Model (DOM)<\/a>. If you incorrectly spell this method, you\u2019ll encounter the <code>document.getElementByID is not a function<\/code> error in your program.<br><\/p>\n\n\n\n<p>This tutorial discusses what this error means and why it is raised. We\u2019ll walk through an example of this error so you can learn what you need to know to fix it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">document.getElementByID is not a function<\/h2>\n\n\n\n<p>The <code>document.getElementById() <\/code>method is one of the JavaScript selector methods. The method retrieves an object based on its ID from the HTML DOM.<br><\/p>\n\n\n\n<p>This method is used to manipulate the contents of an element or retrieve information about a particular element, such as its contents or its attributes.<br><\/p>\n\n\n\n<p>IDs are defined in HTML. An ID must be unique to a particular element:<br><\/p>\n\n\n\n<p><code>&lt;header id=\u201ctop_header\u201d&gt;&lt;\/header&gt;<br><\/code><\/p>\n\n\n\n<p>The <code>&lt;header&gt;<\/code> tag has the ID <code>top_header<\/code>. This ID is unique to the <code>&lt;header&gt;<\/code> tag. IDs are often used to <a href=\"https:\/\/careerkarma.com\/blog\/css-class-vs-id-2\/\">apply styles to particular elements using CSS<\/a>.<br><\/p>\n\n\n\n<p><code>document.getElementById()<\/code> is case-sensitive. This method is not:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>document.getelementbyid()<\/li><li>document.getElementByID()<\/li><li>document.GetElementById()<\/li><\/ul>\n\n\n\n<p>Any other variations on the method name will not be accepted by JavaScript.<br><\/p>\n\n\n\n<p>While it is tempting to write ID in capital letters because it is shorthand for another word, the method requires that you use an uppercase <strong>I<\/strong> and a lowercase <strong>d<\/strong>.<br><\/p>\n\n\n\n<p>To learn more about the getElementById method, read our guide on <a href=\"https:\/\/careerkarma.com\/blog\/javascript-getelementbyidv\/\">JavaScript getElementById<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">An Example Scenario<\/h2>\n\n\n\n<p>We\u2019re going to build a code snippet that welcomes a user to our application. The welcome message will be in a title that appears at the top of our page.<br><\/p>\n\n\n\n<p>For the purposes of this example, we\u2019re going to use a demo name.<br><\/p>\n\n\n\n<p>To start, define our body HTML code for the welcome section of the webpage:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>&lt;html&gt;\n&lt;body&gt;\n&lt;header&gt;\n&lt;h1 id=&quot;welcome_title&quot;&gt;Welcome&lt;\/h1&gt;\n&lt;\/header&gt;\n\t&lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre><\/div>\n\n\n\n<p>By default, our <code>&lt;h1&gt;<\/code> tag will contain the contents <code>Welcome<\/code>. The <code>&lt;header&gt;<\/code> tag is the parent tag in which our title is located.&nbsp; Next, we\u2019re going to add a <code>&lt;script&gt;<\/code> tag below our <a href=\"https:\/\/careerkarma.com\/blog\/html-headers\/\">&lt;header&gt; tag<\/a>. The script tag will contain all of the JavaScript code for our welcome message:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>\u2026\n&lt;\/header&gt;\n&lt;script&gt;\n&lt;\/script&gt;\n\t&lt;\/body&gt;\n...\n<\/pre><\/div>\n\n\n\n<p>Within our script, we are going to select our title and change its contents:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var title = document.getElementByID(&quot;welcome_title&quot;);\ntitle.textContent = &quot;Welcome, Luke!&quot;;\n<\/pre><\/div>\n\n\n\n<p>The <code>getElementById()<\/code> method selects our title. We assign this HTML element to the <a href=\"https:\/\/careerkarma.com\/blog\/javascript-variables\/\">JavaScript variable<\/a> called <code>title<\/code>. The contents of our title will be changed to display \u201cWelcome, Luke!\u201d We use the <code>textContent<\/code> method to change the title.&nbsp;<br><\/p>\n\n\n\n<p>Let\u2019s run our code and see what happens. If we open our <a href=\"https:\/\/careerkarma.com\/blog\/javascript-console\/\">JavaScript console<\/a>, we can see an error:<br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"449\" height=\"54\" src=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-09-28-at-07.47.35.jpg\" alt=\"\" class=\"wp-image-23484\" srcset=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-09-28-at-07.47.35.jpg 449w, https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-09-28-at-07.47.35-385x46.png 385w, https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-09-28-at-07.47.35-20x2.png 20w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><\/figure>\n\n\n\n<p>Our code is not functioning correctly. Our title has not been changed:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"240\" height=\"51\" src=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-09-28-at-07.47.24.jpg\" alt=\"\" class=\"wp-image-23485\" srcset=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-09-28-at-07.47.24.jpg 240w, https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-09-28-at-07.47.24-20x4.png 20w\" sizes=\"auto, (max-width: 240px) 100vw, 240px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">The Solution<\/h2>\n\n\n\n<p>We\u2019ve used the incorrect case for the <code>document.getElementByID<\/code> selector. Instead of using an uppercase <strong>I<\/strong> and a lowercase <strong>d<\/strong>, we have used an uppercase <strong>I<\/strong> and <strong>D<\/strong>.<br><\/p>\n\n\n\n<p>JavaScript does not register our program as calling the <code>getElementById<\/code> function because the function name is case sensitive.<br><\/p>\n\n\n\n<p>We need to change our code so that we use the correct cases for our function:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var title = document.getElementById(&quot;welcome_title&quot;);\ntitle.textContent = &quot;Welcome, Luke!&quot;;\n<\/pre><\/div>\n\n\n\n<p>We are now using <code>Id<\/code> instead of <code>ID<\/code> in our function call. Let\u2019s run our new code:<br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"292\" height=\"53\" src=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-09-28-at-07.48.43.jpg\" alt=\"\" class=\"wp-image-23486\" srcset=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-09-28-at-07.48.43.jpg 292w, https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-09-28-at-07.48.43-20x4.png 20w\" sizes=\"auto, (max-width: 292px) 100vw, 292px\" \/><\/figure>\n\n\n\n<p>Our program successfully changes the contents of our title to include the name of our user.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The <code>document.getElementById()<\/code> method selects an element from the web page. This method lets you view and change the contents of an element.<br>When you use this method, you should make sure that you use the correct cases. ID is not in all capital letters. You need to use an uppercase <strong>I<\/strong> and a lowercase <strong>d<\/strong> for the method to work.<\/p>\n","protected":false},"excerpt":{"rendered":"The JavaScript getElementById method selects an element from the HTML Document Object Model (DOM). If you incorrectly spell this method, you\u2019ll encounter the document.getElementByID is not a function error in your program. This tutorial discusses what this error means and why it is raised. We\u2019ll walk through an example of this error so you can&hellip;","protected":false},"author":240,"featured_media":17625,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[],"class_list":{"0":"post-23483","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-javascript"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"JavaScript","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":[]},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Document.getElementByID is not a function Solution | Career Karma<\/title>\n<meta name=\"description\" content=\"On Career Karma, learn the cause of and the solution to the JavaScript document.getElementByID is not a function error.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript document.getElementByID is not a function Solution\" \/>\n<meta property=\"og:description\" content=\"On Career Karma, learn the cause of and the solution to the JavaScript document.getElementByID is not a function error.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-01T22:03:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:01:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/danial-ricaros-FCHlYvR5gJI-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"JavaScript document.getElementByID is not a function Solution\",\"datePublished\":\"2020-10-01T22:03:28+00:00\",\"dateModified\":\"2023-12-01T12:01:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/\"},\"wordCount\":575,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/danial-ricaros-FCHlYvR5gJI-unsplash.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/\",\"name\":\"Document.getElementByID is not a function Solution | Career Karma\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/danial-ricaros-FCHlYvR5gJI-unsplash.jpg\",\"datePublished\":\"2020-10-01T22:03:28+00:00\",\"dateModified\":\"2023-12-01T12:01:21+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"On Career Karma, learn the cause of and the solution to the JavaScript document.getElementByID is not a function error.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/danial-ricaros-FCHlYvR5gJI-unsplash.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/danial-ricaros-FCHlYvR5gJI-unsplash.jpg\",\"width\":1020,\"height\":680,\"caption\":\"A person writing lines of code on a laptop\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-document-getelementbyid-is-not-a-function\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript document.getElementByID is not a function Solution\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/author\\\/jamesgallagher\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Document.getElementByID is not a function Solution | Career Karma","description":"On Career Karma, learn the cause of and the solution to the JavaScript document.getElementByID is not a function error.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript document.getElementByID is not a function Solution","og_description":"On Career Karma, learn the cause of and the solution to the JavaScript document.getElementByID is not a function error.","og_url":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-10-01T22:03:28+00:00","article_modified_time":"2023-12-01T12:01:21+00:00","og_image":[{"width":1020,"height":680,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/danial-ricaros-FCHlYvR5gJI-unsplash.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"JavaScript document.getElementByID is not a function Solution","datePublished":"2020-10-01T22:03:28+00:00","dateModified":"2023-12-01T12:01:21+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/"},"wordCount":575,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/danial-ricaros-FCHlYvR5gJI-unsplash.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/","url":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/","name":"Document.getElementByID is not a function Solution | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/danial-ricaros-FCHlYvR5gJI-unsplash.jpg","datePublished":"2020-10-01T22:03:28+00:00","dateModified":"2023-12-01T12:01:21+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"On Career Karma, learn the cause of and the solution to the JavaScript document.getElementByID is not a function error.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/danial-ricaros-FCHlYvR5gJI-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/danial-ricaros-FCHlYvR5gJI-unsplash.jpg","width":1020,"height":680,"caption":"A person writing lines of code on a laptop"},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/javascript-document-getelementbyid-is-not-a-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/careerkarma.com\/blog\/javascript\/"},{"@type":"ListItem","position":3,"name":"JavaScript document.getElementByID is not a function Solution"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/23483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=23483"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/23483\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/17625"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=23483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=23483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=23483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}