Results 1 to 4 of 4

Thread: html search box and onmouseover

  1. #1
    Join Date
    Feb 2009
    Posts
    8

    Default html search box and onmouseover

    hello,
    i'd like to have the mouse pointer change to a hand when it hovers over the search button of the html search box. i tried this with no luck:

    <span onmouseover="this.style.cursor= 'hand'"><input type="submit" value="" style="border-style: none; background: url('images/searchbutton2.gif') no-repeat; width: 24px; height: 20px;"></span>

    i know this should be simple but i can't get it to work

    thanks.

  2. #2
    Join Date
    Dec 2004
    Location
    Sydney
    Posts
    4,155

    Default

    I would think using a hand icon would be counter intuitive (or do you mean the hand with a finger pointer). A hand normally implies the ability to drag or grab the item, not click on it.

    Further, most browsers automatically change the pointer when you mouse over a link, or button.

    I have never attempted this in Javscript, so I don't know what is wrong with your code.

  3. #3
    Join Date
    Dec 2004
    Location
    Sydney, Australia
    Posts
    3,571

    Default

    Try placing the onmouseover attribute on the actual input tag instead.

    In other words:

    <input type="submit" value="" style="border-style: none; background: url('images/searchbutton2.gif') no-repeat; width: 24px; height: 20px;" onmouseover="this.style.cursor= 'hand'">
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

  4. #4
    Join Date
    Feb 2009
    Posts
    8

    Default

    Thanks Ray. I then found that this doesn't work in Firefox so changed 'hand' to 'pointer' (as per W3C standard) and it works in both IE and Firefox.

    <input type="submit" value="" style="border-style: none; background: url('images/searchbutton2.gif') no-repeat; width: 24px; height: 20px;" onmouseover="this.style.cursor= 'pointer'">

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •