Using onclick event store data of extra field in codeigniter
tell us more about the problem?
are you going inside function add_fields() ?
Also, just try to put
<p id="content"></p>
and then this,
<script> function add_fields() { var d = document.getElementById("content"); d.innerHTML += "Enter Bank Details<br /> <input type='text' name='bankdetail'/>"; // REMOVE THE COMMA FROM HERE }</script>
remove the comma from innerHTML line, Do let us know if it still doesn't work.