Get form input element value by jQuery and javascript

Get input element value using jQuery different methods and core javascript. Example for get input value by name attribute or by input id/class given below.

Get form input element value using jQuery

//access input by name
$('input[name="FIELDNAME"]').val();

//access input by id/class
$('#INPUT_ID').val();
$('.INPUT_CLASS').val();

//core javascript access input by name
document.getElementsByName('FIELDNAME')[0].value;

//core javascript access input by id
document.getElementById('INPUT_ID').value;

Example: