DEV Community

Cover image for 10 useful HTML5 features, you may not be using

10 useful HTML5 features, you may not be using

Tapas Adhikary on September 17, 2020

HTML5 is not a new thing. We have been using several features of it since the initial release(January 2008). As part of #100DaysOfCode initiative, ...
Collapse
 
sal7one profile image
Saleh Alanazi • Edited

This is so cool, thanks for sharing!. I actually have one I just found out about. If you have an onclick in an HTML tag and you pass "this" as an argument to whatever function you're calling. You can use that HTML element in JS and get it's tag info / modify it, or it's parents/children. without a query selector!!!

try it here! click the button on the far right. (html view)
jsbin.com/feyuhaxivo/edit?html,js,...

Collapse
 
atapas profile image
Tapas Adhikary

Cool, thanks!

Collapse
 
wawrzyn321 profile image
Piotr Wawrzyńczyk

Nice! Some of those are new for me. By the way, there is a little more neat way of getting the numeric input's value - valueAsNumber.

<form oninput="x.value=a.valueAsNumber * b.valueAsNumber">

Thanks for sharing!

Collapse
 
atapas profile image
Tapas Adhikary

Thanks Piotr!

Collapse
 
katiekodes profile image
Katie

To me, map is quite a throwback! People used them for fanciful literal "site maps" on their personal home pages.

Collapse
 
klausbert profile image
Klausbert • Edited

Yes, I had to switch from <map> to <svg> to get the same results in a responsive design.

Collapse
 
froeb profile image
froeb

I agree. Svg is not only providing responsive design, but it is also so much more flexible! Svg is probably still the most underrated feature in web design. The only drawback is that you do not find too many advanced samples in the internet. So, if you like, have a look at my website hegel.net for a sample on how to implement an svg based „imagemap“. Search in the code for the svg tag and within it for the xlink:href code. Enjoy!

Collapse
 
atapas profile image
Tapas Adhikary

You are absolutely right! However I was not aware of it until I figured out about it.. Hence the inclusion... 😁

Thanks Katie for reading the article!

Collapse
 
madza profile image
Madza

A perfect example of how knowing something to the core could save you from adding unnecessary libraries and all the effects that come with it.

Collapse
 
atapas profile image
Tapas Adhikary

That's very true Madza! Thanks for reading through and commenting!

Collapse
 
malzeri83 profile image
malzeri83

It's cool! Bookmarked! Something knew, something new. Don't know where to use but anyway quite interesting to read.

Collapse
 
atapas profile image
Tapas Adhikary

Thank You 🙏

Collapse
 
misterhamm profile image
Chris

Thanks :) It's funny how we can do this for 40-50 hours a week plus and still miss basic features of HTML. Too much confidence in the fact that there's nothing more to learn about HTML. Got my mind churning with a couple of those.

Collapse
 
atapas profile image
Tapas Adhikary

Very true Chris.

Collapse
 
togakangaroo profile image
George Mauer • Edited

Map is certainly not html 5 is it? It should be quite old. I also would recommend it in only the most limited of circumstances. How would it work for responsive websites? What sort of accessibility nightmare might it pose? What possible advantage can it have over simply using an svg?

I'd need to look into it but I would never use it without considering these two all important questions.

As for details. Is nice. I use it on my html resume. But the degree to which you are limited in styling it and all the browser bugs and inconsistencies with it (Was it Firefox or safari where flexbox won't work in summaries?) really limit is usefulness

Collapse
 
ztamizzen profile image
Mats Lindblad

I used map before 2000 so it more like HTML3.

Collapse
 
atapas profile image
Tapas Adhikary

Thanks, will check it out!

Collapse
 
machineno15 profile image
Tanvir Shaikh

Amazing , need more of this .
Thanks for adding up my knowledge.

i realize i would have saved my time instead of adding jquery then writing code to display on click of more button , simply with details tag.

Collapse
 
atapas profile image
Tapas Adhikary

Cool, Thanks Tanvir!

Collapse
 
oti profile image
oti

The description of autofocus is incorrect. Nowhere in the specification is it written "by placing the cursor on it."

html.spec.whatwg.org/multipage/int...

If you want to explain it briefly, how about "an element is to be focused as soon as the page is loaded."

Furthermore, it would be better if there was an explanation of the behavior of the dialog element and div element.

Collapse
 
rajyraman profile image
Natraj Yegnaraman

Good one Tapas. One small feedback - Using contenteditable to make a div behave like an input is not good for accessibility.

Collapse
 
atapas profile image
Tapas Adhikary

Thanks Natraj, for reading through! Great feedback on accessibility!

Collapse
 
agiboire profile image
Adrien

I condemn the choice of font 😁

Collapse
 
atapas profile image
Tapas Adhikary

Haha.. BTW.. That font name is Chilanka! I liked that somehow 🙂

Collapse
 
qq449245884 profile image
qq449245884

Hello, may I translate your article into Chinese?I would like to share it with more developers in China. I will give the original author and original source.

Collapse
 
atapas profile image
Tapas Adhikary

Please go ahead.. You can tweet the link once published 🙂

Collapse
 
qq449245884 profile image
qq449245884

ok, thanks.

Collapse
 
lorenz1989 profile image
lorenz1989

The suggestion below is from ChatGPT and was requested by me.

ChatGPT

Collapse
 
anonystick profile image
anonystick

Hello, may I translate your article into Vietnamese ? I will give the original author and original source. Thanks!

Collapse
 
atapas profile image
Tapas Adhikary

Yeah sure.. You can.. Thanks!

Collapse
 
anonystick profile image
anonystick

Thanks!

Collapse
 
frumpygoose180 profile image
FrumpyGoose180

THAT'S A HUGE CONTENT! I didn't know any of these tags, mindblowing!

Collapse
 
atapas profile image
Tapas Adhikary

Thank you! Very happy that it was useful!

Collapse
 
m121 profile image
Mateo Perez Salazar

Thank you for this list, I think you miss one "blink tag"

Collapse
 
ztamizzen profile image
Mats Lindblad

Blink is a text-decoration today, which no browser supports. For good reason.
Why not go with a "marquee" instead? 😁

Collapse
 
m121 profile image
Mateo Perez Salazar

hahaha I didn't know that

Collapse
 
atapas profile image
Tapas Adhikary

Thanks! Yeah I missed few in fact.. Shall add to the git repo as example this week.

Collapse
 
nikhilmwarrier profile image
nikhilmwarrier

That <details> tags was really neat... Lifesavers.... Thanks a lot....

Collapse
 
atapas profile image
Tapas Adhikary

Thanks... Glad it was useful to you.

Collapse
 
mickaelchanrion profile image
Mickael Chanrion • Edited

Mhh... What's the difference between "meter" and "progress" 🤔 ?
I wasn't aware of the meter tag. Thanks

Collapse
 
atapas profile image
Tapas Adhikary

Thanks!

Collapse
 
mickaelchanrion profile image
Mickael Chanrion

Oups, the html tags are hidden apparently.
I've edited my comment

Collapse
 
banzyme2 profile image
ENDEESA

Learnt a lot from this, thanks!

Collapse
 
atapas profile image
Tapas Adhikary

Thank you very much!

Collapse
 
panshak profile image
Panshak

Very helpful. Never knew some of these tags even exist.

Collapse
 
atapas profile image
Tapas Adhikary

Thanks, Panshak!

Collapse
 
hseleiro profile image
Hugo Seleiro

Thank You !!

Collapse
 
atapas profile image
Tapas Adhikary

🙏

Collapse
 
alokjoshi profile image
AlokJoshiOfAarmax

Super brilliant. Keep writing. You have a knack for it.

Collapse
 
atapas profile image
Tapas Adhikary

Thank you Alok!

Collapse
 
gerardocrdena14 profile image
Gerardo Cárdenas

Hello, the link about DevTools - My Favorite Tips and Tricks
does not work, would you like to fix it?

Collapse
 
atapas profile image
Tapas Adhikary

Hey Thanks for reporting.. I have fixed it now.. Please let me know.

Collapse
 
iamrommel profile image
Rommel C. Manalo

date and datetime-local please for input

Collapse
 
essteffan profile image
Stefan Cuculeac

Nice things to remember!

Collapse
 
mikepijn profile image
Michael Pijnenburg

Cool that you put up a netlify example website!

Link to github example in the Quick Tips of also refers to your netlify website instead of your github readme, you might want to update this?

Collapse
 
atapas profile image
Tapas Adhikary

Hey Thanks!

Changed the link.

I wanted to point to this one: github.com/atapas/notifyme#properties

Collapse
 
jacobmgevans profile image
Jacob Evans

I'm embarrassed to say I didn't know some of these... I definitely need to go make some stuff with them, get really comfortable and familiar with them.

Collapse
 
oricis profile image
Moisés Alcocer

Thanks!
Great post, I discover details / summary, i will clean a lot of CSS tricks of my pages now.

Collapse
 
atapas profile image
Tapas Adhikary

Nice!

Collapse
 
rachel_cheuk profile image
Rachel

Image maps!! Haha I remember making those so many years ago and it was so different!! How things change!!

Thanks for sharing!! Great list!

Collapse
 
atapas profile image
Tapas Adhikary

Thank you!

Collapse
 
ackmandesu profile image
AckmanDESU

The problem with many of these is that they're not supported by IE, which means I am stuck doing things the "old" way.

Collapse
 
atapas profile image
Tapas Adhikary

Yes, that is kind of unfortunate. Which version of IE are you with? A few are supported with IE11 though. But, you are right..many are not at the same time.

Collapse
 
hassanhgfd profile image
Hassan Bazuhair

That was good post. Most of them I don't know any thing about them. So thank you very much

Collapse
 
atapas profile image
Tapas Adhikary

Thank you Hassan! Glad, it was useful.

Collapse
 
scroung720 profile image
scroung720

The more HTML you know the more you realize you have been reinventing the wheel using fancy frameworks

Collapse
 
atapas profile image
Tapas Adhikary

True!

Collapse
 
sonichaos360 profile image
Luciano Joan Vergara

Thank you, very interesting info!

Collapse
 
atapas profile image
Tapas Adhikary

Thank you!

Collapse
 
yosracodes profile image
Yosra

seriously this is amazing and it would save me so much time! thank you for this!

Collapse
 
atapas profile image
Tapas Adhikary

Thank you Yosra! Glad, it was useful..

Collapse
 
fahimahmed525 profile image
Md.Sanaullah(fahim)

Awesome

Collapse
 
atapas profile image
Tapas Adhikary

Thank you!

Collapse
 
mylawvietnam profile image
Mylaw.vn

Too me, it this tit useful for me, thanks share

Collapse
 
atapas profile image
Tapas Adhikary

Great, thank you!

Collapse
 
3ankur profile image
Ankur V

Thank you for sharing 👍

Collapse
 
atapas profile image
Tapas Adhikary

Thank you!

Collapse
 
raounek profile image
touibeg mohamed

thank you a good job ...

Collapse
 
atapas profile image
Tapas Adhikary

Thank you!

Collapse
 
momandalex022 profile image
Christine Marshall

your information is great for beginner developers like myself thank you for keeping things easy to understand and showing complete examples!

Collapse
 
atapas profile image
Tapas Adhikary

Thank you for the great feedback, Christine! Glad, it was helpful 🙂

Collapse
 
omawhite profile image
Omar White

I didn’t realize there were so many tags I was unaware of. Great post.

Collapse
 
atapas profile image
Tapas Adhikary

Thanks Omar!

Collapse
 
tatianacodes profile image
Tatiana

Wow, and here I am trying to do a lot of these things in JS. Who knew HTML could do so much!

Collapse
 
atapas profile image
Tapas Adhikary

Yeah true. Thanks, Tatiana!

Collapse
 
vishnuharidas profile image
Vishnu Haridas

Wow, that's a cool list of items! Thanks for sharing!

Collapse
 
atapas profile image
Tapas Adhikary

Thanks Vishnu!

Collapse
 
timbogdanov profile image
Tim Bogdanov

Wicked!

Collapse
 
atapas profile image
Tapas Adhikary

😁

Collapse
 
cyroilt profile image
cyroilt

Thanks, it was great and good examples

Collapse
 
atapas profile image
Tapas Adhikary

Thanks!

Collapse
 
nexusdenim profile image
Nexus Denim

Niceeee. I didn't know that autocomplete and some of these new tags are this much great, and here I use tons of libraries for getting all these. Incredible...

Collapse
 
atapas profile image
Tapas Adhikary

Thank you!

Collapse
 
surajv profile image
Surajv

This article is simply awesome! Got to know a lot of new things :) Thanks for sharing!

Collapse
 
atapas profile image
Tapas Adhikary

Thank you Suraj!

Collapse
 
edydeyemi profile image
Edydeyemi

This is quite useful. I honestly did not know most of these features exist.

Collapse
 
atapas profile image
Tapas Adhikary

Thanks Edydeyemi!

Collapse
 
atapas profile image
Tapas Adhikary

Thanks Felipe! I m glad, it was useful to you.

Collapse
 
amineamami profile image
amineamami

Just awesome 👌

Collapse
 
atapas profile image
Tapas Adhikary

Thank you! 🙏

Collapse
 
tannu2790 profile image
Tarun Saini

Worth sharing.
igmguru.com/

Collapse
 
leob profile image
leob

I was aware of datalist, that's a pretty powerful one.

Collapse
 
levxyca profile image
Leticia @levxyca

Wow! It's awesome. Thanks for writing this article.

Collapse
 
atapas profile image
Tapas Adhikary

You are welcome.

Collapse
 
oussbelat profile image
oussama belattar

cool tricks we need more of this