<input type="text" class="city_" value='Test' /> <input type="submit" value="ok" /> <script> alert(document.getElementsByClassName("city_")[0].value) ; </script>