私は次のコードを使用しています:
<div class="example">
<p> <a href="#info" rel="facebox">View Facebox</a> </p>
<p> <input id="Button1" type="button" value="button" onclick="Get_Value();"/></p>
</div>
<div id="info" style="display:none;">
<p><input id="text1" name="text1" type="text" value="abc"/></p>
<p> <input id="Button2" type="button" value="button" onclick="Get_Value();$.facebox.close(); return;"/> </p>
<script type="text/javascript">
function Get_Value()
{
alert($('#text1').val());
var myTextField = document.getElementById('text1');
alert("You entered: " + myTextField.value)
}
</script>
問題は、アラートステートメントで、テキストボックスtext1の初期値「abc」を常に取得していることです。ただし、フェイスボックス内で開いたときにユーザーが入力する値はありません。誰か助けてくれませんか?