$('#category').val(data.category_id); not working code example Example: get value of input jqueyr var str = $("#myInput"). val();