Don't confuse PHP with JavaScript. To access the value of an element via JavaScript, you can do it by getElemenetById(). Or make use of the jQuery that provides several selectors.

For example, to access an input element with id "myname", you can use the following in jQuery:
Code:
$('#myname').val()
For more, google it.