Create textbox dynamically in td next to specified td in html table using jquery
<p><a href="https://i.stack.imgur.com/DZhb6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DZhb6.png" alt="enter image description here"></a></p>

<p>Hello all,
I need to create textbox dynamically(depending on condition), when user clicks on employee it should get added next to employee, if user clicks on another element, it should get added next to another element</p>

<p>I have tried following, but I am not able to get exact td and function by which i can append textbox to it.</p>

<pre><code>$("#emlpyeetd").after('&lt;s:textfield id="employeeVal" name="employeeView.policyOrQuoteNumber" maxlength="15" style="width: 200px;" class="hideForAnotherField" theme="simple"&gt;&lt;/s:textfield&gt;');


&lt;td width="25%"&gt;
  employee
&lt;/td&gt;
&lt;td id="policytd" class= "anotherfield" width="25%"&gt;&lt;/td&gt;
</code></pre>