DEV Community

Cover image for Console.time & 4 other webdev tips you may want to know πŸš€
Mustapha Aouas
Mustapha Aouas

Posted on

Console.time & 4 other webdev tips you may want to know πŸš€

1. Console.time

You can use console.time() to starts a timer to track how long an operation takes. Also, you can also use the timeLog method in between the start and the end of the timer. Here’s a quick example:

Console.time

Β 

2. The importance of input types

You can improve the UX of your app by using the correct input type so the phones/tablets can choose the best keyboard to show to the end user:

input types

Β 

3. CSS where

The :where() Css pseudo-class function takes a selector list as its argument, and selects any element that can be selected by one of the selectors in that list. The code below produce the same output (exept the specificity is different) but the second one is more concise:

CSS where

There's a lot to say about :is() and :where(). if you want to read more aboute these pseudo-class selectors, you can click on the link below πŸ‘‡

Β 


Hi there! I'm Mustapha, a technical writer, speaker and a passionate JS / TS developer. Follow me on Twitter for daily tech tips πŸš€


Β 

4. The spellcheck attribute

The spellcheck attribute defines whether an element may be checked for spelling errors.
You can use it in text inputs, textarea and editable content (elements with contenteditable="true").

spellcheck attribute

Β 

5. Attribute selectors

Did you know about the different ways you can use the attribute selectors in CSS?
Have a look:

Attribute selectors

Note that the selector is case sensitive. If you want it to be case insensitive, add an I before the closing bracket:

Attribute selectors not case sensitive

Β 
Β 

That's all for now. I hope you found this useful!
Leave a comment to let me know which tip (if any) you found useful ‡

Until next time, have a nice week!

Β 

What to read next?

Top comments (4)

Collapse
 
davidfree2 profile image
Humberto David Esquerra

These are awesome and I will be trying them out :)

Collapse
 
mustapha profile image
Mustapha Aouas

Thank you πŸ™ I am glad you like them!

Collapse
 
troy5890 profile image
Troy Harris

That CSS :where() is a lifesaver for time. I'll definitely be using it for my next project

Collapse
 
mailtodanish profile image
Mohd Ahshan Danish

I will use these in my codes.