var captcha = '29keAaYhjly7E'; $(document).ready(function() { $("#captcha").attr("value", captcha); });