SyntaxFix
Write A Post
Hire A Developer
Questions
Try this. It will work for sure.
var userInput = $('#txt_name').attr('value')