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>


File containing jquery code is sginin.js and am trying access jquery library from 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;
style given to the above div is
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

1 Answer 1

2

This is not the way selecting the document ready handlers, This should be like:

$(document).ready(function() { 
//^------^--------------------------------remove the quotes and see if works
       $(document).delegate('#target','submit',function(e) { 
//  ----^-------^------------------------------------------------and this one too
          alert('hi'); 
          return false;
       });
 });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.