var deger = $("#test").val();
alert(deger);

Not: jQuery yüklü olmalı. test id sine sahip inputun değerini alırsın.