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