Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meta tag: do I use name or id?

I saw that in HTML5, you don't use the name attribute, but use the id attribute, instead. I also saw that you write metadata with the name attribute. So which one of them should I use while writing metadata?

<meta name="" content="">  

OR

<meta id="" content="">` 
like image 704
E. Epstein Avatar asked Oct 15 '25 23:10

E. Epstein


1 Answers

you don't use the name attribute, but use the id attribute

This only applies to a elements (whose name attribute is deprecated in favor of giving the closest element a corresponding ID). It doesn't apply to any other element with a name attribute, neither input, nor meta. In other words, you cannot replace the name attribute with an ID for any other element. Anyone suggesting otherwise is wrong.

like image 100
BoltClock Avatar answered Oct 17 '25 12:10

BoltClock



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!