1

I am using an image map which contains a lot of <area> tags. I have alt attributes for each of the area which gets popped up as a tooltip in IE. Can we suppress this behavior? I tried using empty title attribute but it did not work.

Edit: I need the alt attribute for other screen readers. So i cannot just make it empty ir remove it. I just want to supress its popping up behavior in IE. am

vpram86
  • 5,860
  • 4
  • 28
  • 40

4 Answers4

3

.......

<area onmouseover="this.alt = '';">

I know Javascript shouldn't be inline, but you can convert it into function easily.

Update: With JQuery

$(function(){
  $('area').mouseover(function(){
    $(this).attr('alt', '');
  });
});
Sarfraz
  • 377,238
  • 77
  • 533
  • 578
2

Check if the browser is IE using navigator.appName etc. (unreliable).

If it is IE, remove all alt attributes of the <area> tags (not tested):

var area_tags = document.getElementsByTagName("area");
for (var i = area_tags.length-1; i >= 0; -- i)
  area_tags[i].removeAttribute("alt");

Or just don't care.

kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
  • :) I guess i will go with 'Just dont care option'. Also, i can put another function to refill the alt onmouseout apart from removing it using onmouseover. Thanks! – vpram86 Feb 25 '10 at 09:50
0

Use empty alt attributes

<area alt="" />

See Blank alt attributes

rahul
  • 184,426
  • 49
  • 232
  • 263
-1

Use a style like area.alt {display: none;} to suppress the alt.

Kangkan
  • 15,267
  • 10
  • 70
  • 113