I need to create a row with ajax in a javascript function, but i'm having a lot of trouble finding the correct syntax.
This is the HTML final result i want to get:
<td style="text-align:center">
<input type="image" src="nienteico.png" style="cursor:pointer; width:40px; height:40px" id="5.51" class="ajaxEdit" onclick="cambiastato(5.51)">
</td>
And this is the JS code that needs to be modified:
<td style="+'text-align:center'+"><input type="+'image'+" src="+'nienteico.png'+" style="+'cursor:pointer; width:40px; height:40px'+" id="+'5.51'+" class="+'ajaxEdit'+" onclick="+'cambiastato(5.51)'+"></input></td>
Finally this is the HTML i obtain using js i have written before:
<td style="text-align:center"><input type="image" src="nienteico.png" style="cursor:pointer;" width:40px;="" height:40px="" id="5.51" class="ajaxEdit" onclick="cambiastato(5.51)"></td>
Thanks in advance!
createElement,setAttribute,appendChild, etc. It's much easier to manage.