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