faressoft<\/a><\/figcaption><\/figure><\/div>\n\n\n\n\u4e5f\u5c31\u662f\u8aaa\uff0c\u57fa\u672c\u4e0a HTML attributes \u7d93\u904e\u89e3\u6790\u5f8c\uff0c\u5c31\u6703\u7522\u751f\u76f8\u5c0d\u61c9\u7684 DOM properties \u3002\u800c DOM \u5be6\u8cea\u4e0a\u5176\u5be6\u662f JavaScript object \uff0c\u56e0\u6b64\u5b58\u53d6 DOM properties \u7684\u65b9\u6cd5\u5c31\u548c\u5b58\u53d6 JavaScript \u4e2d\u7684 object \u4e00\u6a23\u3002<\/p>\n\n\n\n
<div id=\"root\" class=\"hello\" data-key=\"1\">\n <img id=\"image\" src=\"https:\/\/i.imgur.com\/AK2FguR.jpeg\" alt=\"\u5716\u7247\" >\n<\/div>\n<script>\n console.log(document.getElementById(\"root\").className)\n \/\/ hello\n \/\/ id, className \u5c31\u662f div \u7684 DOM properties\n console.log(document.getElementById(\"image\").src)\n \/\/ https:\/\/i.imgur.com\/AK2FguR.jpeg\n \/\/ id, src, alt \u5c31\u662f img \u7684 DOM properties\n<\/script><\/code><\/pre>\n\n\n\nDOM properties \u7684\u7279\u6027\u5982\u4e0b :<\/p>\n\n\n\n