Search code examples
javascriptimagedom-eventsborder

Javascript mouseover, add border to image


I have some circle buttons on my website that I want to get a blue outline when you mouseover.

<img src="/images/example.png" onmouseover="JavascriptHere">

How would I do this? The website I am trying to do this on is http://www.inglesfield.com/. I already have a mousedown event to prevent image dragging, would it be possible to have both events (mousedown and mouseover) independently?


Solution

  • you can add a css hover style on the images

    #content:hover { border: 2px solid blue; border-radius: 100px; }
    

    by the way: instead of using ids for the images, use class="content", because ids should be unique on a html page