i use a javascript to add a input box in my table as below:

```
var inputtopik = "topik" + 1;
$("#titleinput tbody").append("<tr><td> Topik " + topikno +
                              " : </td><td><input type='text' id='" +
                              inputtopik +"' style='WIDTH:498px;' ></td></tr>");

```

and then try to get the value by this

```
var topik = document.getElementById('inputtopik').value;

```

but got an error state

```
Uncaught TypeError: Cannot read property 'value' of null 

```

i wonder why? maybe it cannot find the input box that ive just add? how to fix?
help :(