0

web.dev's mobile nav menu sets an attribute of open without a value

<web-navigation-drawer type="standard" animating="" open="">

How can I achieve this?

something.attr('open')
something.attr('open', '')

Both produce open="open"

.prop() doesn't seem to work either.

Any thoughts on how they're doing this?

(Note: open="open" is perfectly fine, I just think open is cleaner - and clearly so do Google)

Thanks in advance, Mr J.

Mr. J
  • 317
  • 6
  • 20
  • Don't worry about the cleanliness of HTML markup - it's only the *source* code that needs to be clean (for developers to be able to analyze and work with) – CertainPerformance Mar 09 '22 at 00:06
  • Not sure why this has been marked as [duplicate], the answers within the other questions don't work in this scenario (and were the first places I looked). Regardless of html cleanliness, it would be nice to find out how the Google devs achieved this. – Mr. J Mar 10 '22 at 18:19

0 Answers0