简体   繁体   中英

CSS selector for html element on mouseover

At first I understand both Xpath and CSS selector notation are different. http://ejohn.org/blog/xpath-css-selectors/

Basically I need to generate html element CSS selector on mousover.

(to make you understand generate Xpath or specifically CSS selector of the Html element on mouseover on an element). I tried with event.data.selector Is there any api or sample code

The selector for mouseover specifically is to append :hover in your CSS document.

So if you wanted to have a hover for an element with an ID of "hoverDiv", you would have something like this:

#hoverDiv:hover { background-color: red; }

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