简体   繁体   中英

javascript how to change the color of links onmouseover table cell?

I am making a navigation bar and would like the link to change color after mousover of the table cell, not the link. Is there a quick way for this? Or to get an element by its tag? (GetElementByTag("a"))

As @Stuart said, add the following to your css, and make sure your css is included in your html.

td:hover a {
  color: blue
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM