Home >Web Front-end >HTML Tutorial >How to change the style of another control in mouseenter?_html/css_WEB-ITnose
If there are two controls, ctl0 and ctl1, and you hear the mouse passing by the ctl0 control, how to change the foreground and background colors of the ctl1 control?
$(document).ready(function(){
$( "ctl0").mouseenter(function(){
$('ct1').css('background-color:red;color:white') Try
Thank you, but ctl1 is the class name of the control, not the control ID, and it is of the same type There is more than one name. I want to change the style of only one of them, such as .ctls1 .ctl1, but it doesn’t work.
$(this).css('background-color:red;color:white')
Is this just changing the control that triggers the event?