jQuery(document).ready(function ($) { $('#'+id).val(key); }); var id = 'subkey1'; var key = '3c818557ee843095e681940d07faad48';