Get input value by id, class, and name using jQuery

First, create an input.

<input id="test_id" class="test_class" name="test_name" type="hidden" value="test" />

1. Get a value by id

var value = $('#test_id').val();

2. Get a value by class

var value = $('.test_class').val();

3. Get a value by name

var value = $('input[name=test_name]').val(); 

Simple?