Question: so I'm having trouble with getting the value of a specific field in my code - I made this pretty simple example to show my problem, here is the JSFiddle:
<https://jsfiddle.net/c3jtg60v/>

The HTML:

```
<p id="theInput">
   desired-value
</p>

```

The Javascript:

```
var value = document.getElementById("theInput").value;
console.log(value);

```

As is, I have assigned a **p** element with an id of "theInput", and in it I have the desired value, that I want to make use of in my javascript.

At the moment, all I'm trying to do is console.log the value, but when I do this, all i get logged in the console is 'undefined'. What I really want to get logged to the console is "desired value",

Answer: 
```
var value = document.getElementById("theInput").innerHTML;
console.log(value);

```
There is also another solution if the HTML Element you are looking for, **does not have** an "**id**" tag.
Officially if you would like to take the "value" of the element, you would do something like this:

```
var value = document.getElementById("someId").value

```

But sometimes ther is no "**id**" of that element, so you can use something like this:

```
var element =  document.getElementsByClassName("className") as HTMLCollectionOf<HTMLElement>

```

This will return a collection of the HTML elements. And then you simply chose the element you want, by it's index and take the value like that:

```
var value = element[index]['value']

```