PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

html search box and onmouseover

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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

      Comment


      • #4
        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'">

        Comment

        Working...
        X