Solution 1:

//Get
var bla = $('#txt_name').val();

//Set
$('#txt_name').val(bla);

Solution 2:

You can only select a value with the following two ways:

// First way to get a value
value = $("#txt_name").val(); 

// Second way to get a value
value = $("#txt_name").attr('value');

If you want to use straight JavaScript to get the value, here is how:

document.getElementById('txt_name').value