jQuery implements the method of mouse over to modify the style

  • 2020-05-27 04:24:41
  • OfStack

This article demonstrates an example of how jQuery can be used to modify styles with a mouse stroke. Share with you for your reference. The details are as follows:


$(document).ready(function () {
 // Styles by default 
 $("input:text").attr("style","border:1px solid #7E9DB9;");
 // Mouse over the style 
 $("input:text").mouseover(function () {
  $(this).attr("style","border:1px solid #EDBB72;");
 });
 // Mouse over the styles 
 $("input:text").mouseout(function () {
  $(this).attr("style","border:1px solid #7E9DB9;");
 });
});

I hope this article has been helpful to your jQuery programming.


Related articles: