I have a few tds ..I need to get the values from each of them and then need to total it.The error which i am facing = Cannot read property 'innerText' of null.

I want solve this problem without jquery..(only using javascript)

Html code;

```
<td id="price1">300</td>
<td id="price2">110</td>
<td id="price3">350</td>
<td id="price4">100</td>
<td id="total">I need Total Here</td>

```

Js code;

```
var price1 = parseInt(document.getElementById("price1").innerText);
var price2 = parseInt(document.getElementById("price2").innerText);
var price3 = parseInt(document.getElementById("price3").innerText);
var price4 = parseInt(document.getElementById("price4").innerText);
var total = (price1+price2+price3+price4);

document.getElementById("total").innerHtml = total;

```

Error;

```
Cannot read property 'innerText' of null

```

[Fiddle](https://jsfiddle.net/yLt05aq9/)

PS:I am a self-taught programmer.I am very new to Javascript.Excuse me for any grammar mistakes,wrongly formatted code,some silly,stupid mistake which i have done.

Thanks in advance,
Sangamesh