2

In my app I need to display some maps. So I use Leaflet.js to do so, but to simplify my HTML I have used a <map> tag to do so. Is that acceptable, or should I avoid doing this?

3
  • 1
    What do you mean by using map to display some maps and by changing the behavior of old tags? The map element does not display anything (it only defines areas in an image). – Jukka K. Korpela Jun 17 '13 at 10:19
  • map is not an old element and is part of HTML5. – Rob Jun 17 '13 at 11:21
  • I don't found any info that map is deprecated. I mean that in my JS I'm looking for all <map> tags, in them I create <div> with unique, generated id and in them I display my Leaflet map. – Hauleth Jun 17 '13 at 11:27
3

From accessibility this would be incorrect, because <map> tag is:

The map element, in conjunction with any area element descendants, defines an image map.

(source from W3C)

StackOverflow gives a good answer about custom elements.

2
  • 1
    No. Do not create your own HTML tags. Use XHTML if you want to do that. Otherwise, don't. – Rob Jun 17 '13 at 11:25
  • @Rob thanks for your comment , you are right! Edited the answer! – Igor-G Jun 17 '13 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.