jQuery排他思想
作者:互联网
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>jQuery的排他思想</title> <script src="jquery-1.11.3.min.js"></script> </head> <body> <button>快速</button> <button>快速</button> <button>快速</button> <button>快速</button> <button>快速</button> <button>快速</button> <button>快速</button> <script> $('button').click(function() { $(this).css('color','red'); $(this).siblings().css('color',''); // $(this).css('color','red').siblings().css('color',''); }) </script> </body> </html>
标签:jQuery,思想,color,red,siblings,快速,css 来源: https://www.cnblogs.com/wuyuchuan/p/14809138.html