---
title: "getelementbyid has no method using javascript"  
description: "getelementbyid has no method using javascript"  
author: "Anonymous User"  
published: 2013-08-19  
updated: 2013-08-19  
canonical: https://www.mindstick.com/forum/1399/getelementbyid-has-no-method-using-javascript  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# getelementbyid has no method using javascript

Hi Minsdstick!\
\

I have a pull down menu, what i would like is that when there is a change with the pull down that a <div> displays that was previously hidden. But I keep [getting an error](https://answers.mindstick.com/qa/95244/why-do-you-keep-getting-an-error-message-ox800ccc0b) of:

uncaught typerror:object #<[HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) [Document](https://www.mindstick.com/articles/328642/what-to-consider-while-choosing-a-software-documentation-tool)> has no [method](https://www.mindstick.com/forum/166/webservice-method) 'getElementByID'

**Here is the [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii):**

```
 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0   
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   <html xmlns="http://www.w3.org/1999/xhtml">   <head>   
<title>landing3</title>   <meta
http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"><script type="text/javascript">function showdiv() {document.getElementByID("DIV1").style.display =
"inline-block";}</script></head><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0">      <select id="awf_field-28500717" name="custom Country" tabindex="503" onChange="showdiv()">        <option class="multiChoice" value="United States">United States</option>        <option class="multiChoice" value="Canada">Canada</option>        <option
class="multiChoice" value="United Kingdom">United Kingdom</option>        <option class="multiChoice" value="Australia">Australia</option>        <option selected>Select</option>      </select>    <div id="DIV1" name="DIV1" style="display:none;">    Test    </div></body></html>
```

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)\

## Replies

### Reply by shreesh chandra shukla

Hi!

You have getElementByID while the actual method is getElementById

```
<script type="text/javascript">  function showdiv() {   
document.getElementById("DIV1").style.display =
"inline-block";   }</script>
```


---

Original Source: https://www.mindstick.com/forum/1399/getelementbyid-has-no-method-using-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
