<html>
<head>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
alert('hi'+$("input:text").val());
$("input:not(:empty)").val("sdfdf");
});
});
</script>
</head>
<body>
<input type="text" value="aa" />
<input type="text" value="" />
<input type="text" value="aa" />
<button>Click me</button>
</body>
</html>
Я пытаюсь получить доступ к пустому текстовому поле с помощью jquery и присваивать ему значение hello. но он не работает.
заблаговременно