Switch to full style
JQuery Examples
Post a reply

click,double click,focus,blur and hover actions in JQuery

Sat Dec 29, 2012 9:54 pm

Code:
<html>
<
head>
<
title>click,dblclick,focus,blur and hover actions</title>
<
script src="jquery-1.8.3.js"></script>
<script>
// Waits until the all document is loaded.
$(document).ready(function(){
// Show alert when any double click to paragraphs
 $("#da").dblclick(function(){
   alert("Double Click");
});

 $("#da2").click(function(){
   alert("Single click");
});

 

 $("input.newa").focus(function(){
    $(this).css("background-color","#CC44FF");
});

 $("input.newa").blur(function(){
   $(this).css("background-color","#4488F2");
});

  

 $("#da3").hover(function(){
  $(this).css("background-color","#00F0FA");
  },
  function(){
   $(this).css("background-color","#FFFFFF");
});  

}); 

</script>

</head>
<body>
  
  <p id="da">Double click here to see the message</p>
  
  <p id="da2">Single Click here to see the message</p>
  
  <input type="text" size="50" class="newa" />
  
  <p id="da3"> Hover on text </p>

</body>
</html>




Post a reply
  Related Posts  to : click,double click,focus,blur and hover actions in JQuery
 disable right click on your web page     -  
 Detecting right mouse button click     -  
 Hide the background image by one click     -  
 Show image when click on link     -  
 Javascript Code For Moving Images On Click Of A Button     -  
 Draw Circles using using Polar form equations-On mouse Click     -  
 Draw Bezier Curve and selecting the points with mouse click     -  
 Show hint when focus on html element using JQuery     -  
 table row hover     -  
 form-Radio-buttons-checkBoxs-actions-HTML-Tags     -  

Topic Tags

JQuery Selector