Home  >  Article  >  Web Front-end  >  jQuery implements the method of modifying the style when the mouse is passed_jquery

jQuery implements the method of modifying the style when the mouse is passed_jquery

WBOY
WBOYOriginal
2016-05-16 16:04:061480browse

The example in this article describes how jQuery implements mouse-over modification of styles. Share it with everyone for your reference. The details are as follows:

$(document).ready(function () {
 //默认情况下样式
 $("input:text").attr("style","border:1px solid #7E9DB9;");
 //鼠标移入样式
 $("input:text").mouseover(function () {
  $(this).attr("style","border:1px solid #EDBB72;");
 });
 //鼠标移开样式
 $("input:text").mouseout(function () {
  $(this).attr("style","border:1px solid #7E9DB9;");
 });
});

I hope this article will be helpful to everyone’s jQuery programming.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn