入力ボックスの値を取得し、クエリ文字列として URL に渡します。次のように表示または非表示に制御されるデフォルト値「Enter Keywords(address....)」を取得したくありません。
//**onClick and OnLostFocus (focus and blur) events on textareas and input textboxes**
$('input[type="text"], textarea').focus(function () {
defaultText = $(this).val();
$(this).val('');
});
$('input[type="text"], textarea').blur(function () {
if ($(this).val() == "") {
$(this).val(defaultText);
}
});
<input name="KeywordBox" class="BasicSearchInputBox" type="text" size="300" value="Enter Keywords (address,city and state OR zipcode)"/>
デフォルトのテキストではなく、ユーザー入力だけを取得するには?? jqueryで?