Question: Let's say there is an

```
<input id="exist" type="text">

```

and its value is **'something is in here'.**

So in the console, I typed several codes.. to check 'input.value' is 'true'...

These are the codes..

```
var a = document.getElementById='exist';
a.value;         // result : 'something is in here'
a.value == 1;    // result : false
a.value == true; // result : false

```

But when input.exist was has empty value, results were like below.

```
a.value; // result : ''
a.value == 1;      // result : false
a.value == true;   // result : false
a.value == 0;      // result : true
a.value == false;  // result : true

```

Why this happening? How to check about elem.input.value is true?

Answer: 
The reason '' == 0 is because in Javascript, == will use type coercion to attempt to equate the values. If you want to check to see if the values are equal without type coercion, use ===.

A simple way to check for a value being present is !!a.value (!a.value will be true when the value is empty, negated again makes it false)
the `a.value` will be always a String. So if you want to check if the value is exactly `"true"` then you should use `a.value === "true"`.