2012-12-04 45 views
0
<div class="sld_dwn"> 
<form class="sign_in_form" id='target'> 
<div> 
<a class="sign_in_data" >email:</a> 
</br> 
<input type="text" class="sign_in_box" name='txt1'> 
<a class="sign_in_data1">password:</a> 
</br> 
<input type="password" class="sign_in_box1"name='txt2' > 
</div> 
<a href='http://localhost' class="forgot">forgot password</a></br> 
<!--<input type="checkbox"><a class="stay">stay signin</a>--> 
<input type='submit' class="but_signin1" value='Sign in'> 
</form> 


文件包含jQuery代碼是sginin.js,我試圖從 http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js
$("document").ready(function() { $("document").delegate('#target','submit',function(e) { alert('hi'); return false;
風格定接入jQuery庫上述股利是
div.sld_dwn { position:relative; border-radius:0px; display:none; float:right; right:40px; background-color:#3E003E; background-color:RGBA(255, 255, 255,0.2); color:white; border:0px; width:450px; height:120px; }

+1

在這裏可以正常工作http://jsfiddle.net/rbuh2/ –

回答

2

這不是選擇文檔準備好處理程序的方式,這應該是這樣的:

$(document).ready(function() { 
//^------^--------------------------------remove the quotes and see if works 
     $(document).delegate('#target','submit',function(e) { 
// ----^-------^------------------------------------------------and this one too 
      alert('hi'); 
      return false; 
     }); 
}); 
+0

非常感謝Jai的工作。 – akhil