function getValue()
{
alert(document.getElementById('user').value);
return true
}
<a href="my.html" onclick="return getvalue()">Go</a>
ユーザーがハイパーリンクをクリックすると、にリダイレクトする前に、関数my.htmlを呼び出す必要がgetValue()あります。この関数は、id が であるテキストボックスからユーザー名を表示しますuser。