HTML attributes vs DOM properties

Attributes and properties are fundamentally different things. You can have an attribute and property of the same name set to different values. For example: <div foo="bar">…</div> <script> const div = document.querySelector('div[foo=bar]'); console.log(div.getAttribute('foo')); // 'bar' console.lo...

みんなの反応

はてなブックマークでの反応
※メールアドレスは公開されません。
"ねとなび"は今ネットで話題になっている最新記事と最新ニュースを全部まとめてチェックすることができるサイトです。 スマートフォンからも同じURLで閲覧できます。
人気の反応
ニュース
comments powered by Disqus