Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript innerHTML print misplaced
    primarykey
    data
    text
    <pre><code>&lt;table class="privilage"&gt; &lt;caption&gt; These are the default users for institution &lt;/caption&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Users Name&lt;/th&gt; &lt;th&gt;User Id&lt;/th&gt; &lt;th&gt;Password&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="text" name='DefaultUser[]' value='' &gt;&lt;br&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" name='DefaultUser_UserName[]' value=''&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="password" name='DefaultUser_Password[]'&gt;&lt;/td&gt; &lt;/tr&gt; &lt;div id="New_User"&gt;&lt;/div&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="button" name="Add_New_User" value="Add new User" onclick="addRow()"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>The above HTML have a div named New_User, I asked the below javascript to print ussing innerHTML to that div, but it prints out elsewhere. </p> <pre><code> function addRow() { var d= document.getElementById("New_User"); d.innerHTML+="&lt;tr&gt;&lt;th&gt;&lt;input type='text' name='DefaultUsers' value=''/&gt; Manager&lt;br&gt;&lt;/th&gt;&lt;th&gt;&lt;input type='text' name='UserName' value=''/&gt;&lt;/th&gt;&lt;th&gt;&lt;input type='password' name='Password'/&gt;&lt;/th&gt;&lt;/tr&gt;"; }​ </code></pre> <p>I just need to add those new row to the 'privilage' table. Any Consideration and help are welcome. Thanks in Advance.</p> <p><a href="http://jsfiddle.net/abelkbil/QPY6b/" rel="nofollow"> Jsfiddle code</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload