I should add rows to the table with jQuery:
<table class="table">
<tbody id="dh-values">
</tbody>
</table>
I’ve written the following code:
function displayHash(fieldName) {
$('#dh-values').append('<tr></tr>').append('<td id="dh-'+fieldName+'">'+$('#'+fieldName).val()+'</td>').append('<td id="dh-'+fieldName+'-h">'+hex_sha1($('#'+fieldName).val())+'</td>');
};
But it looks awful. Is there any way to simplify that?
Combined answer of Esalija, amnotiam et al
DEMO