views:

199

answers:

4

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

A: 

Use empty alt attributes

<area alt="" />

See Blank alt attributes

rahul
A: 

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

Kangkan
+2  A: 

.......

<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
+2  A: 

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
:) 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!
Aviator