$('body').append('<input id = "myInput" /><input type = "submit" />') .find('input[@type=submit]').click(function() { val = $('#myInput').val(); $('body').html('<a href = '#'>click here</a>').find('a').click(function() { $('body').html('You said: ' + val); }); });
<input id="in" type="text" /><input type="submit" onclick="window.result='You said: '+document.getElementById('in').value; document.body.innerHTML='<a href=\'#\' onclick=\'document.body.innerHTML=window.result;\'>click here</a>'" value="Submit"/>
(it's a big hack, I know)
-----