Category: 

What Is an HTML Hover?

Article Details
  • Written By: Eugene P.
  • Edited By: Angela B.
  • Last Modified Date: 02 September 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
Roughly one-fifth of the world's stock of gold - worth over $200 billion USD - is stored under the streets of London.  more...

September 30 ,  1949 :  The Berlin Air Lift ended.  more...

Within a web browser that is displaying a HyperText Markup Language (HTML) document, an HTML hover is an action or event that is generated through user input. By strict definition, an HTML hover is what happens when the mouse cursor on a screen comes to rest on an element within the web page, triggering a hover event that can be responded to by code placed inside the web page. The actual effect can be anything from displaying some navigational text to changing an image to make it appear highlighted, or even modifying some separate property on the web page. Some web browsers and operating systems define a hover event a little differently, so selections using the tab key on a keyboard also will be considered hovering. HTML hover events are usually capture by cascading style sheet (CSS) code, JavaScript® functions or a combination of both, because basic HTML has no facility to interact directly with a hovering cursor.

Most computer operating systems that accept user input actually break down each seemingly simple action into a sequence of stages, or events. Web browsers must be able to interpret and respond to these events so users can interact with a web page. These events are generated by the computer system in response to a user action, passed to the web browser, and then made available to any active programs that are listening for the events attached to the HTML page.

Ad

When a mouse cursor passes over an element in an HTML document, it actually generates at least three separate events. The first is when the mouse initially comes into contact with the element, which is known as an enter or onMouseEnter event. The last event generated when the mouse leaves the element is called an exit or onMouseExit event. The period of time in which the mouse is sitting inside the element between these two events is known as hovering, and it generates an HTML hover event. One thing to note about hovering is that a mouse does not always have to sit perfectly still to be considered hovering, the event can be automatically triggered just by entering the elements space.

Navigation assistance is one common use for an HTML hover event, popping up some informational text at the location of the mouse cursor when a link or image is passed over. It also can used to provide short textual definitions of words in a document. More often, it is used for aesthetic purposes, such as making graphical dials or arrows animate when the mouse gives them focus. Although there are many security precautions to prevent it, particularly malicious code can sometimes use an HTML hover event over a blank space on a web page to cause pop-up windows to appear outside the web browser.

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

exception 'Exception' with message 'error writing captcha: Duplicate entry '2147483647' for key 'PRIMARY'' in /ssd/www/wisegeek/public_html/_core/classes/public/Captcha.php:44
Stack trace:
#0 /ssd/www/wisegeek/public_html/_core/controls/public/ControlDiscussionPostBox.php(324): Captcha->createCaptcha()
#1 /ssd/www/wisegeek/public_html/framework/classes/Control.php(104): ControlDiscussionPostBox->preRender(false)
#2 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): Control->render()
#3 /ssd/www/wisegeek/public_html/tpl/default-nocustom-lu/pages/public/article/article.htm(526): Control->__toString()
#4 /ssd/www/wisegeek/public_html/framework/classes/Control.php(300): require('/ssd/www/wisege...')
#5 /ssd/www/wisegeek/public_html/framework/classes/Control.php(309): Control->requireTpl('pages/public/ar...', Object(PageArticleCom), true)
#6 /ssd/www/wisegeek/public_html/framework/classes/Control.php(131): Control->renderTpl('pages/public/ar...', Object(PageArticleCom))
#7 /ssd/www/wisegeek/public_html/framework/classes/FormDataControl.php(87): Control->renderTemplate()
#8 /ssd/www/wisegeek/public_html/framework/classes/Control.php(109): FormDataControl->renderTemplate()
#9 /ssd/www/wisegeek/public_html/framework/classes/ScriptPage.php(50): Control->render(false)
#10 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): ScriptPage->render()
#11 /ssd/www/wisegeek/public_html/framework/classes/Page.php(97): Control->__toString()
#12 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(443): Page->processRequest()
#13 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(7): PublicFrontController->renderPage()
#14 /ssd/www/wisegeek/public_html/index.php(11): PublicFrontController::run()
#15 {main}