{"id":5507,"date":"2016-11-11T18:01:39","date_gmt":"2016-11-11T10:01:39","guid":{"rendered":"https:\/\/sdeno.com\/?p=5507"},"modified":"2016-11-11T18:06:06","modified_gmt":"2016-11-11T10:06:06","slug":"javascript-%e6%93%8d%e4%bd%9c-dom-%e7%9a%84%e9%82%a3%e4%ba%9b%e5%9d%91","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=5507","title":{"rendered":"JavaScript \u64cd\u4f5c DOM \u7684\u90a3\u4e9b\u5751"},"content":{"rendered":"<p><code style=\"color: #c7254e;\">js<\/code>\u5728\u64cd\u4f5c<code style=\"color: #c7254e;\">DOM<\/code>\u4e2d\u5b58\u5728\u7740\u8bb8\u591a\u8de8\u6d4f\u89c8\u5668\u65b9\u9762\u7684\u5751\uff0c\u672c\u6587\u82b1\u4e86\u6211\u5c06\u8fd1\u4e00\u5468\u7684\u65f6\u95f4\u6574\u7406\uff0c\u6211\u5c06\u6839\u636e\u5b9e\u4f8b\u6574\u7406\u90a3\u4e9b\u5927\u5927\u5c0f\u5c0f\u7684\u201c\u5751\u201d\u3002<\/p>\n<p><code style=\"color: #c7254e;\">DOM<\/code>\u7684\u5de5\u4f5c\u6a21\u5f0f\u662f\uff1a\u5148\u52a0\u8f7d\u6587\u6863\u7684\u9759\u6001\u5185\u5bb9\u3001\u518d\u4ee5\u52a8\u6001\u65b9\u5f0f\u5bf9\u5b83\u4eec\u8fdb\u884c\u5237\u65b0\uff0c\u52a8\u6001\u5237\u65b0\u4e0d\u5f71\u54cd\u6587\u6863\u7684\u9759\u6001\u5185\u5bb9\u3002<\/p>\n<p>PS\uff1a<code style=\"color: #c7254e;\">IE<\/code>\u00a0\u4e2d\u7684\u6240\u6709\u00a0<code style=\"color: #c7254e;\">DOM<\/code>\u00a0\u5bf9\u8c61\u90fd\u662f\u4ee5\u00a0<code style=\"color: #c7254e;\">COM<\/code>\u00a0\u5bf9\u8c61\u7684\u5f62\u5f0f\u5b9e\u73b0\u7684\uff0c\u8fd9\u610f\u5473\u7740\u00a0<code style=\"color: #c7254e;\">IE<\/code>\u00a0\u4e2d\u7684\u00a0<code style=\"color: #c7254e;\">DOM<\/code>\u53ef\u80fd\u4f1a\u548c\u5176\u4ed6\u6d4f\u89c8\u5668\u6709\u4e00\u5b9a\u7684\u5dee\u5f02\u3002<\/p>\n<h2 id=\"articleHeader0\">Node \u63a5\u53e3<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u7279\u6027\/\u65b9\u6cd5<\/th>\n<th align=\"center\">\u7c7b\u578b\/\u8fd4\u56de\u7c7b\u578b<\/th>\n<th align=\"right\">\u8bf4 \u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>nodeName<\/td>\n<td align=\"center\">String<\/td>\n<td align=\"right\">\u8282\u70b9\u7684\u540d\u5b57\uff1b\u6839\u636e\u8282\u70b9\u7684\u7c7b\u578b\u800c\u5b9a\u4e49<\/td>\n<\/tr>\n<tr>\n<td>nodeValue<\/td>\n<td align=\"center\">String<\/td>\n<td align=\"right\">\u8282\u70b9\u7684\u503c\uff1b\u6839\u636e\u8282\u70b9\u7684\u7c7b\u578b\u800c\u5b9a\u4e49<\/td>\n<\/tr>\n<tr>\n<td>nodeType<\/td>\n<td align=\"center\">Number<\/td>\n<td align=\"right\">\u8282\u70b9\u7684\u7c7b\u578b\u5e38\u91cf\u503c\u4e4b\u4e00<\/td>\n<\/tr>\n<tr>\n<td>ownerDocument<\/td>\n<td align=\"center\">Document<\/td>\n<td align=\"right\">\u8fd4\u56de\u67d0\u5143\u7d20\u7684\u6839\u5143\u7d20<\/td>\n<\/tr>\n<tr>\n<td>firstChild<\/td>\n<td align=\"center\">Node<\/td>\n<td align=\"right\">\u6307\u5411\u5728childNodes\u5217\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>lastChild<\/td>\n<td align=\"center\">Node<\/td>\n<td align=\"right\">\u6307\u5411\u5728childNodes\u5217\u8868\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>childNodes<\/td>\n<td align=\"center\">NodeList<\/td>\n<td align=\"right\">\u6240\u6709\u5b50\u8282\u70b9\u7684\u5217\u8868<\/td>\n<\/tr>\n<tr>\n<td>previousSibling<\/td>\n<td align=\"center\">Node<\/td>\n<td align=\"right\">\u8fd4\u56de\u9009\u5b9a\u8282\u70b9\u7684\u4e0a\u4e00\u4e2a\u540c\u7ea7\u8282\u70b9\uff0c\u82e5\u4e0d\u5b58\u5728\uff0c\u5219\u8fd4\u56denull<\/td>\n<\/tr>\n<tr>\n<td>nextSibling<\/td>\n<td align=\"center\">Node<\/td>\n<td align=\"right\">\u8fd4\u56de\u88ab\u9009\u8282\u70b9\u7684\u4e0b\u4e00\u4e2a\u540c\u7ea7\u8282\u70b9\uff0c\u82e5\u4e0d\u5b58\u5728\uff0c\u5219\u8fd4\u56denull<\/td>\n<\/tr>\n<tr>\n<td>hasChildNodes()<\/td>\n<td align=\"center\">Boolean<\/td>\n<td align=\"right\">\u5982\u679c\u5f53\u524d\u5143\u7d20\u8282\u70b9\u62e5\u6709\u5b50\u8282\u70b9\uff0c\u8fd4\u56detrue\uff0c\u5426\u5219\u8fd4\u56defalse<\/td>\n<\/tr>\n<tr>\n<td>attributes<\/td>\n<td align=\"center\">NamedNodeMap<\/td>\n<td align=\"right\">\u8fd4\u56de\u5305\u542b\u88ab\u9009\u8282\u70b9\u5c5e\u6027\u7684 NamedNodeMap<\/td>\n<\/tr>\n<tr>\n<td>appendChild(node)<\/td>\n<td align=\"center\">node<\/td>\n<td align=\"right\">\u5c06node\u6dfb\u52a0\u5230childNodes\u7684\u672b\u5c3e<\/td>\n<\/tr>\n<tr>\n<td>removeChild(node)<\/td>\n<td align=\"center\">node<\/td>\n<td align=\"right\">\u4ecechildNodes\u4e2d\u5220\u9664node<\/td>\n<\/tr>\n<tr>\n<td>replaceChild(newnode, oldnode)<\/td>\n<td align=\"center\">Node<\/td>\n<td align=\"right\">\u5c06childNodes\u4e2d\u7684oldnode\u66ff\u6362\u6210newnode<\/td>\n<\/tr>\n<tr>\n<td>insertBefore<\/td>\n<td align=\"center\">Node<\/td>\n<td align=\"right\">\u5728\u5df2\u6709\u5b50\u8282\u70b9\u4e4b\u524d\u63d2\u5165\u65b0\u7684\u5b50\u8282\u70b9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><code style=\"color: #c7254e;\">firstChild<\/code>\u00a0\u76f8\u5f53\u4e8e\u00a0<code style=\"color: #c7254e;\">childNodes[0]<\/code>\uff1b<code style=\"color: #c7254e;\">lastChild<\/code>\u00a0\u76f8\u5f53\u4e8e<code style=\"color: #c7254e;\">childNodes[box.childNodes.length - 1]<\/code>\u3002<\/p>\n<h3 id=\"articleHeader1\">nodeType\u8fd4\u56de\u7ed3\u70b9\u7684\u7c7b\u578b<\/h3>\n<pre class=\"hljs sql\" style=\"color: #657b83;\"><code style=\"color: inherit;\"><span class=\"hljs-comment\" style=\"color: #93a1a1;\">--\u5143\u7d20\u7ed3\u70b9\u8fd4\u56de1<\/span>\r\n<span class=\"hljs-comment\" style=\"color: #93a1a1;\">--\u5c5e\u6027\u7ed3\u70b9\u8fd4\u56de2<\/span>\r\n<span class=\"hljs-comment\" style=\"color: #93a1a1;\">--\u6587\u672c\u7ed3\u70b9\u8fd4\u56de3 <\/span><\/code><\/pre>\n<h3 id=\"articleHeader2\">innerHTML \u548c nodeValue<\/h3>\n<pre class=\"hljs\" style=\"color: #657b83;\"><code style=\"color: inherit;\">\u5bf9\u4e8e\u6587\u672c\u8282\u70b9\uff0cnodeValue \u5c5e\u6027\u5305\u542b\u6587\u672c\u3002\r\n\r\n\u5bf9\u4e8e\u5c5e\u6027\u8282\u70b9\uff0cnodeValue \u5c5e\u6027\u5305\u542b\u5c5e\u6027\u503c\u3002\r\n\r\nnodeValue \u5c5e\u6027\u5bf9\u4e8e\u6587\u6863\u8282\u70b9\u548c\u5143\u7d20\u8282\u70b9\u662f\u4e0d\u53ef\u7528\u7684\u3002\r\n<\/code><\/pre>\n<p><strong style=\"font-weight: bold;\">\u4e24\u8005\u533a\u522b<\/strong><\/p>\n<pre class=\"hljs xml\" style=\"color: #657b83;\"><code style=\"color: inherit;\">box.childNodes[0].nodeValue = '<span class=\"hljs-tag\">&lt;<span class=\"hljs-title\" style=\"color: #268bd2;\">strong<\/span>&gt;<\/span>abc<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-title\" style=\"color: #268bd2;\">strong<\/span>&gt;<\/span>';\/\/\u7ed3\u679c\u4e3a\uff1a<span class=\"hljs-tag\">&lt;<span class=\"hljs-title\" style=\"color: #268bd2;\">strong<\/span>&gt;<\/span>abc<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-title\" style=\"color: #268bd2;\">strong<\/span>&gt;<\/span>\r\nabcbox.innerHTML = '<span class=\"hljs-tag\">&lt;<span class=\"hljs-title\" style=\"color: #268bd2;\">strong<\/span>&gt;<\/span>abc<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-title\" style=\"color: #268bd2;\">strong<\/span>&gt;<\/span>';\/\/\u7ed3\u679c\u4e3a\uff1aabc\r\n<\/code><\/pre>\n<h3 id=\"articleHeader3\">nodeName\u5c5e\u6027\u83b7\u5f97\u7ed3\u70b9\u540d\u79f0<\/h3>\n<pre class=\"hljs cs\" style=\"color: #657b83;\"><code style=\"color: inherit;\">--\u5bf9\u4e8e\u5143\u7d20\u7ed3\u70b9\u8fd4\u56de\u7684\u662f\u6807\u8bb0\u540d\u79f0,\u5982\uff1a&lt;a herf&gt;&lt;a&gt;\u8fd4\u56de\u7684\u662f<span class=\"hljs-string\" style=\"color: #2aa198;\">\"a\"<\/span>\r\n--\u5bf9\u4e8e\u5c5e\u6027\u7ed3\u70b9\u8fd4\u56de\u7684\u662f\u5c5e\u6027\u540d\u79f0,\u5982\uff1a<span class=\"hljs-keyword\" style=\"color: #859900;\">class<\/span>=<span class=\"hljs-string\" style=\"color: #2aa198;\">\"test\"<\/span> \u8fd4\u56de\u7684\u662ftest\r\n--\u5bf9\u4e8e\u6587\u672c\u7ed3\u70b9\u8fd4\u56de\u7684\u662f\u6587\u672c\u7684\u5185\u5bb9 <\/code><\/pre>\n<h3 id=\"articleHeader4\">tagName<\/h3>\n<pre class=\"hljs coffeescript\" style=\"color: #657b83;\"><code style=\"color: inherit;\"><span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.getElementByTagName(tagName)\uff1a\u8fd4\u56de\u4e00\u4e2a\u6570\u7ec4\uff0c\u5305\u542b\u5bf9\u8fd9\u4e9b\u7ed3\u70b9\u7684\u5f15\u7528<\/code><\/pre>\n<p><code style=\"color: #c7254e;\">getElementsByTagName()<\/code>\u65b9\u6cd5\u5c06\u8fd4\u56de\u4e00\u4e2a\u5bf9\u8c61\u6570\u7ec4\u00a0<code style=\"color: #c7254e;\">HTMLCollection(NodeList)<\/code>\uff0c\u8fd9\u4e2a\u6570\u7ec4\u4fdd\u5b58\u7740\u6240\u6709\u76f8\u540c\u5143\u7d20\u540d\u7684\u8282\u70b9\u5217\u8868\u3002<\/p>\n<pre class=\"hljs javascript\" style=\"color: #657b83;\"><code style=\"color: inherit;\"><span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.getElementsByTagName(<span class=\"hljs-string\" style=\"color: #2aa198;\">'*'<\/span>);<span class=\"hljs-comment\" style=\"color: #93a1a1;\">\/\/\u83b7\u53d6\u6240\u6709\u5143\u7d20<\/span>\r\n<\/code><\/pre>\n<p>PS\uff1a<code style=\"color: #c7254e;\">IE<\/code>\u00a0\u6d4f\u89c8\u5668\u5728\u4f7f\u7528\u901a\u914d\u7b26\u7684\u65f6\u5019\uff0c\u4f1a\u628a\u6587\u6863\u6700\u5f00\u59cb\u7684\u00a0<code style=\"color: #c7254e;\">html<\/code>\u00a0\u7684\u89c4\u8303\u58f0\u660e\u5f53\u4f5c\u7b2c\u4e00\u4e2a\u5143\u7d20\u8282\u70b9\u3002<\/p>\n<pre class=\"hljs javascript\" style=\"color: #657b83;\"><code style=\"color: inherit;\"><span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.getElementsByTagName(<span class=\"hljs-string\" style=\"color: #2aa198;\">'li'<\/span>);<span class=\"hljs-comment\" style=\"color: #93a1a1;\">\/\/\u83b7\u53d6\u6240\u6709 li \u5143\u7d20\uff0c\u8fd4\u56de\u6570\u7ec4<\/span>\r\n<span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.getElementsByTagName(<span class=\"hljs-string\" style=\"color: #2aa198;\">'li'<\/span>)[<span class=\"hljs-number\" style=\"color: #2aa198;\">0<\/span>];<span class=\"hljs-comment\" style=\"color: #93a1a1;\">\/\/\u83b7\u53d6\u7b2c\u4e00\u4e2a li \u5143\u7d20\uff0cHTMLLIElement<\/span>\r\n<span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.getElementsByTagName(<span class=\"hljs-string\" style=\"color: #2aa198;\">'li'<\/span>).item(<span class=\"hljs-number\" style=\"color: #2aa198;\">0<\/span>);<span class=\"hljs-comment\" style=\"color: #93a1a1;\">\/\/\u83b7\u53d6\u7b2c\u4e00\u4e2a li \u5143\u7d20\uff0cHTMLLIElement<\/span>\r\n<span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.getElementsByTagName(<span class=\"hljs-string\" style=\"color: #2aa198;\">'li'<\/span>).length;<span class=\"hljs-comment\" style=\"color: #93a1a1;\">\/\/\u83b7\u53d6\u6240\u6709 li \u5143\u7d20\u7684\u6570\u76ee<\/span>\r\n<\/code><\/pre>\n<h3 id=\"articleHeader5\">\u8282\u70b9\u7684\u7edd\u5bf9\u5f15\u7528\uff1a<\/h3>\n<pre class=\"hljs cs\" style=\"color: #657b83;\"><code style=\"color: inherit;\">\u8fd4\u56de\u6587\u6863\u7684\u6839\u8282\u70b9\uff1adocument.documentElement\r\n\u8fd4\u56de\u5f53\u524d\u6587\u6863\u4e2d\u88ab\u51fb\u6d3b\u7684\u6807\u7b7e\u8282\u70b9\uff1adocument.activeElement\r\n\u8fd4\u56de\u9f20\u6807\u79fb\u51fa\u7684\u6e90\u8282\u70b9\uff1a<span class=\"hljs-keyword\" style=\"color: #859900;\">event<\/span>.fromElement\r\n\u8fd4\u56de\u9f20\u6807\u79fb\u5165\u7684\u6e90\u8282\u70b9\uff1a<span class=\"hljs-keyword\" style=\"color: #859900;\">event<\/span>.toElement\r\n\u8fd4\u56de\u6fc0\u6d3b\u4e8b\u4ef6\u7684\u6e90\u8282\u70b9\uff1a<span class=\"hljs-keyword\" style=\"color: #859900;\">event<\/span>.srcElement\r\n<\/code><\/pre>\n<h3 id=\"articleHeader6\">\u8282\u70b9\u7684\u76f8\u5bf9\u5f15\u7528\uff1a(\u8bbe\u5f53\u524d\u5bf9\u8282\u70b9\u4e3anode)<\/h3>\n<pre class=\"hljs\" style=\"color: #657b83;\"><code style=\"color: inherit;\">\u8fd4\u56de\u7236\u8282\u70b9\uff1anode.parentNode || node.parentElement\uff08IE\uff09\r\n\u8fd4\u56de\u5b50\u8282\u70b9\u96c6\u5408\uff08\u5305\u542b\u6587\u672c\u8282\u70b9\u53ca\u6807\u7b7e\u8282\u70b9\uff09\uff1anode.childNodes\r\n\u8fd4\u56de\u5b50\u6807\u7b7e\u8282\u70b9\u96c6\u5408\uff1anode.children\r\n\u8fd4\u56de\u5b50\u6587\u672c\u8282\u70b9\u96c6\u5408\uff1anode.textNodes\r\n\u8fd4\u56de\u7b2c\u4e00\u4e2a\u5b50\u8282\u70b9\uff1anode.firstChild\r\n\u8fd4\u56de\u6700\u540e\u4e00\u4e2a\u5b50\u8282\u70b9\uff1anode.lastChild\r\n\u8fd4\u56de\u540c\u5c5e\u4e0b\u4e00\u4e2a\u8282\u70b9\uff1anode.nextSibling\r\n\u8fd4\u56de\u540c\u5c5e\u4e0a\u4e00\u4e2a\u8282\u70b9\uff1anode.previousSibling \r\n<\/code><\/pre>\n<h3 id=\"articleHeader7\">\u8282\u70b9\u4fe1\u606f<\/h3>\n<pre class=\"hljs\" style=\"color: #657b83;\"><code style=\"color: inherit;\">\u662f\u5426\u5305\u542b\u67d0\u8282\u70b9\uff1anode.contains()\r\n\r\n\u662f\u5426\u6709\u5b50\u8282\u70b9node.hasChildNodes() \r\n<\/code><\/pre>\n<h3 id=\"articleHeader8\">\u521b\u5efa\u65b0\u8282\u70b9<\/h3>\n<pre class=\"hljs\" style=\"color: #657b83;\"><code style=\"color: inherit;\">createDocumentFragment()\uff0d\uff0d\u521b\u5efa\u6587\u6863\u788e\u7247\u8282\u70b9\r\ncreateElement(tagname)\uff0d\uff0d\u521b\u5efa\u6807\u7b7e\u540d\u4e3atagname\u7684\u5143\u7d20\r\ncreateTextNode(text)\uff0d\uff0d\u521b\u5efa\u5305\u542b\u6587\u672ctext\u7684\u6587\u672c\u8282\u70b9\r\n<\/code><\/pre>\n<h2 id=\"articleHeader9\">\u83b7\u53d6\u9f20\u6807\u70b9\u51fb\u4e8b\u4ef6\u7684\u4f4d\u7f6e<\/h2>\n<pre class=\"hljs javascript\" style=\"color: #657b83;\"><code style=\"color: inherit;\"><span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.onclick = mouseClick;\r\n\r\n<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"color: #859900;\">function<\/span> <span class=\"hljs-title\" style=\"color: #268bd2;\">mouseClick<\/span><span class=\"hljs-params\">(ev)<\/span><\/span>{\r\n    ev = ev || <span class=\"hljs-built_in\" style=\"color: #268bd2;\">window<\/span>.event;<span class=\"hljs-comment\" style=\"color: #93a1a1;\">\/\/window.event\u7528\u6765\u517c\u5bb9IE<\/span>\r\n    <span class=\"hljs-keyword\" style=\"color: #859900;\">var<\/span> x = <span class=\"hljs-number\" style=\"color: #2aa198;\">0<\/span>; <span class=\"hljs-keyword\" style=\"color: #859900;\">var<\/span> y = <span class=\"hljs-number\" style=\"color: #2aa198;\">0<\/span>;\r\n\r\n    <span class=\"hljs-keyword\" style=\"color: #859900;\">if<\/span>(ev.pageX){\r\n        x = ev.pageX;\r\n        y = ev.pageY;\r\n    }<span class=\"hljs-keyword\" style=\"color: #859900;\">else<\/span> <span class=\"hljs-keyword\" style=\"color: #859900;\">if<\/span>(ev.clientX){\r\n        <span class=\"hljs-keyword\" style=\"color: #859900;\">var<\/span> offsetX = <span class=\"hljs-number\" style=\"color: #2aa198;\">0<\/span> , offsetY = <span class=\"hljs-number\" style=\"color: #2aa198;\">0<\/span>;\r\n        <span class=\"hljs-keyword\" style=\"color: #859900;\">if<\/span>(<span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.documentElement.scrollLeft){\r\n            offsetX = <span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.documentElement.scrollLeft;\r\n            offsetY = <span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.documentElement.scrollTop;\r\n        }<span class=\"hljs-keyword\" style=\"color: #859900;\">else<\/span> <span class=\"hljs-keyword\" style=\"color: #859900;\">if<\/span>(<span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.body){\r\n            offsetX = <span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.body.scrollLeft;\r\n            offsetY = <span class=\"hljs-built_in\" style=\"color: #268bd2;\">document<\/span>.body.scrollTop;\r\n        }\r\n        x = ev.clientX + offsetX;\r\n        y = ev.clientY + offsetY;\r\n    }\r\n    alert(<span class=\"hljs-string\" style=\"color: #2aa198;\">\"\u4f60\u70b9\u51fb\u7684\u4f4d\u7f6e\u662f x=\"<\/span>+ x + <span class=\"hljs-string\" style=\"color: #2aa198;\">\" y=\"<\/span> + y);\r\n}\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u6240\u63cf\u8ff0\u7684\u5c5e\u6027\u5728<code style=\"color: #c7254e;\">chrome<\/code>\u548c<code style=\"color: #c7254e;\">Safari<\/code>\u00a0\u90fd\u5f88\u7ed9\u529b\u7684\u652f\u6301\u4e86\u3002<\/p>\n<p>\u95ee\u9898\u4e00\uff1a<code style=\"color: #c7254e;\">Firefox<\/code>\uff0c<code style=\"color: #c7254e;\">Chrome<\/code>\u3001<code style=\"color: #c7254e;\">Safari<\/code>\u548c<code style=\"color: #c7254e;\">IE9<\/code>\u90fd\u662f\u901a\u8fc7\u975e\u6807\u51c6\u4e8b\u4ef6\u7684<code style=\"color: #c7254e;\">pageX<\/code>\u548c<code style=\"color: #c7254e;\">pageY<\/code>\u5c5e\u6027\u6765\u83b7\u53d6web\u9875\u9762\u7684\u9f20\u6807\u4f4d\u7f6e\u7684\u3002<code style=\"color: #c7254e;\">pageX\/Y<\/code>\u83b7\u53d6\u5230\u7684\u662f\u89e6\u53d1\u70b9\u76f8\u5bf9\u6587\u6863\u533a\u57df\u5de6\u4e0a\u89d2\u8ddd\u79bb\uff0c\u4ee5\u9875\u9762\u4e3a\u53c2\u8003\u70b9\uff0c\u4e0d\u968f\u6ed1\u52a8\u6761\u79fb\u52a8\u800c\u53d8\u5316<\/p>\n<p>\u95ee\u9898\u4e8c\uff1a\u5728IE \u4e2d\uff0c<code style=\"color: #c7254e;\">event<\/code>\u00a0\u5bf9\u8c61\u6709\u00a0<code style=\"color: #c7254e;\">x<\/code>,\u00a0<code style=\"color: #c7254e;\">y<\/code>\u00a0\u5c5e\u6027\uff08\u4e8b\u4ef6\u53d1\u751f\u7684\u4f4d\u7f6e\u7684\u00a0<code style=\"color: #c7254e;\">x<\/code>\u00a0\u5750\u6807\u548c\u00a0<code style=\"color: #c7254e;\">y<\/code>\u00a0\u5750\u6807\uff09\u706b\u72d0\u4e2d\u6ca1\u6709\u3002\u5728\u706b\u72d0\u4e2d\uff0c\u4e0e<code style=\"color: #c7254e;\">event.x<\/code>\u00a0\u7b49\u6548\u7684\u662f\u00a0<code style=\"color: #c7254e;\">event.pageX<\/code>\u3002<code style=\"color: #c7254e;\">event.clientX<\/code>\u00a0\u4e0e\u00a0<code style=\"color: #c7254e;\">event.pageX<\/code>\u00a0\u6709\u5fae\u5999\u7684\u5dee\u522b\uff08\u5f53\u6574\u4e2a\u9875\u9762\u6709\u6eda\u52a8\u6761\u7684\u65f6\u5019\uff09\uff0c\u4e0d\u8fc7\u5927\u591a\u6570\u65f6\u5019\u662f\u7b49\u6548\u7684\u3002<\/p>\n<p><code style=\"color: #c7254e;\">offsetX<\/code>:<code style=\"color: #c7254e;\">IE<\/code>\u7279\u6709\uff0c<code style=\"color: #c7254e;\">chrome<\/code>\u4e5f\u652f\u6301\u3002\u9f20\u6807\u76f8\u6bd4\u8f83\u4e8e\u89e6\u53d1\u4e8b\u4ef6\u7684\u5143\u7d20\u7684\u4f4d\u7f6e,\u4ee5\u5143\u7d20\u76d2\u5b50\u6a21\u578b\u7684\u5185\u5bb9\u533a\u57df\u7684\u5de6\u4e0a\u89d2\u4e3a\u53c2\u8003\u70b9,\u5982\u679c\u6709<code style=\"color: #c7254e;\">boder<\/code>,\u53ef\u80fd\u51fa\u73b0\u8d1f\u503c<\/p>\n<p>\u95ee\u9898\u4e09\uff1a<br \/>\n<code style=\"color: #c7254e;\">scrollTop<\/code>\u4e3a\u6eda\u52a8\u6761\u5411\u4e0b\u79fb\u52a8\u7684\u8ddd\u79bb\uff0c\u6240\u6709\u6d4f\u89c8\u5668\u90fd\u652f\u6301<code style=\"color: #c7254e;\">document.documentElement<\/code>\u3002<\/p>\n<p>\u5176\u4f59\u53c2\u7167\uff1a<a style=\"color: #009a61;\" href=\"http:\/\/segmentfault.com\/a\/1190000002559158#articleHeader11\">http:\/\/segmentfault.com\/a\/1190000002559158#articleHeader11<\/a><\/p>\n<h3 id=\"articleHeader10\">\u53c2\u7167\u8868<\/h3>\n<p>\uff08<code style=\"color: #c7254e;\">+<\/code>\u4e3a\u652f\u6301\uff0c<code style=\"color: #c7254e;\">-<\/code>\u4e3a\u4e0d\u652f\u6301\uff09\uff1a<\/p>\n<pre class=\"hljs\" style=\"color: #657b83;\"><code style=\"color: inherit;\">offsetX\/offsetY\uff1aW3C- IE+ Firefox- Opera+ Safari+ chrome+\r\n\r\nx\/y\uff1aW3C- IE+ Firefox- Opera+ Safari+ chrome+\r\n\r\nlayerX\/layerY\uff1aW3C- IE- Firefox+ Opera- Safari+ chrome+\r\n\r\npageX\/pageY\uff1aW3C- IE- Firefox+ Opera+ Safari+ chrome+\r\n\r\nclientX\/clientY\uff1aW3C+ IE+ Firefox+ Opera+ Safari+ chrome+\r\n\r\nscreenX\/screenY\uff1aW3C+ IE+ Firefox+ Opera+ Safari+ chrome+\r\n<\/code><\/pre>\n<p>\u67e5\u770b\u4e0b\u65b9<code style=\"color: #c7254e;\">DEMO<\/code>\uff1a<br \/>\n\u4f60\u4f1a\u53d1\u73b0<code style=\"color: #c7254e;\">offsetX<\/code>\u5728<code style=\"color: #c7254e;\">Firefox<\/code>\u4e0b\u662f<code style=\"color: #c7254e;\">undefined<\/code>\uff0c\u5728<code style=\"color: #c7254e;\">chrome<\/code>\u548c<code style=\"color: #c7254e;\">IE<\/code>\u5219\u4f1a\u6b63\u5e38\u663e\u793a\u3002<br \/>\nhttps:\/\/jsfiddle.net\/f4am208m\/embedded\/result\/<a href=\"https:\/\/sdeno.com\/?attachment_id=5508\" rel=\"attachment wp-att-5508\"><figure class=\"mdx-lazyload-container\" style=\"max-width:644px\"><div style=\"padding-top:54.037267080745%\"><\/div><div class=\"mdx-img-loading-sp mdui-valign\"><div><div class=\"mdui-spinner\"><\/div><\/div><\/div><img width=\"644\" height=\"348\" class=\"alignnone size-full wp-image-5508 lazyload\" title=\"dom1\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" data-src=\"https:\/\/sdeno.com\/wp-content\/uploads\/2016\/11\/dom1.jpg\" alt=\"dom1\"><\/figure><\/a><\/p>\n<p>&nbsp;<\/p>\n<p style=\"color: #3e3e3e;\"><strong>offsetLeft\u548cstyle.left\u533a\u522b<\/strong><\/p>\n<p style=\"color: #3e3e3e;\">1.style.left\u8fd4\u56de\u7684\u662f\u5b57\u7b26\u4e32\uff0c\u6bd4\u598210px\u3002\u800coffsetLeft\u8fd4\u56de\u7684\u662f\u6570\u503c\uff0c\u6bd4\u5982\u6570\u503c10<\/p>\n<p style=\"color: #3e3e3e;\">2.style.left\u662f\u53ef\u8bfb\u5199\u7684\uff0coffsetLeft\u662f\u53ea\u8bfb\u7684<\/p>\n<p style=\"color: #3e3e3e;\">3.style.left\u7684\u503c\u9700\u8981\u4e8b\u5148\u5b9a\u4e49(\u5728\u6837\u5f0f\u8868\u4e2d\u5b9a\u4e49\u65e0\u6548\uff0c\u53ea\u80fd\u53d6\u5230\u5728html\u4e2d\u5b9a\u4e49\u7684\u503c)\uff0c\u5426\u5219\u53d6\u5230\u7684\u503c\u662f\u7a7a\u7684<\/p>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>getComputedStyle\u4e0ecurrentStyle<\/strong><\/span><\/p>\n<p style=\"color: #3e3e3e;\">getComputedStyle()\u63a5\u53d7\u4e24\u4e2a\u53c2\u6570\uff1a\u8981\u53d6\u5f97\u8ba1\u7b97\u6837\u5f0f\u7684\u5143\u7d20\u548c\u4e00\u4e2a\u4f2a\u5143\u7d20\uff0c\u5982\u679c\u4e0d\u9700\u8981\u4f2a\u5143\u7d20\uff0c\u5219\u53ef\u4ee5\u662fnull\u3002\u7136\u800c\uff0c\u5728IE\u4e2d\uff0c\u5e76\u4e0d\u652f\u6301getComputedStyle\uff0cIE\u63d0\u4f9b\u4e86currentStyle\u5c5e\u6027\u3002<\/p>\n<p style=\"color: #3e3e3e;\">getComputedStyle(obj , false ) \u662f\u652f\u6301 w3c (FF12\u3001chrome 14\u3001safari)\uff1a\u5728FF\u65b0\u7248\u672c\u4e2d\u53ea\u9700\u8981\u7b2c\u4e00\u4e2a\u53c2\u6570\uff0c\u5373\u64cd\u4f5c\u5bf9\u8c61\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u5199\u201cfalse\u201d\u4e5f\u662f\u5927\u5bb6\u901a\u7528\u7684\u5199\u6cd5\uff0c\u76ee\u7684\u662f\u4e3a\u4e86\u517c\u5bb9\u8001\u7248\u672c\u7684\u706b\u72d0\u6d4f\u89c8\u5668\u3002<\/p>\n<p style=\"color: #3e3e3e;\">\u7f3a\u70b9:\u5728\u6807\u51c6\u6d4f\u89c8\u5668\u4e2d\u6b63\u5e38\uff0c\u4f46\u5728IE6\/7\/8\u4e2d\u4e0d\u652f\u6301<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">onload<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">var<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">oBtn<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;btn&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">var<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">oDiv<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;div1&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">oBtn<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">onclick<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/alert(oDiv.style.width); \/\/\u5199\u5728\u6837\u5f0f\u8868\u91cc\u65e0\u6cd5\u8bfb\u53d6\uff0c\u53ea\u80fd\u5f97\u5230\u5199\u5728\u884c\u5185\u7684<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/alert(getComputedStyle(oDiv).width); \/\/\u9002\u7528\u4e8e\u6807\u51c6\u6d4f\u89c8\u5668\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IE6\u30017\u30018\u4e0d\u8bc6\u522b<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/alert(oDiv.currentStyle.width); \/\/\u9002\u7528\u4e8eIE\u6d4f\u89c8\u5668\uff0c\u6807\u51c6\u6d4f\u89c8\u5668\u4e0d\u8bc6\u522b<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">oDiv<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">currentStyle<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">alert<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">oDiv<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">currentStyle<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">width<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">alert<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getComputedStyle<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">oDiv<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">width<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">};<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #333333 !important;\">};<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>\u53d6\u6d88\u8868\u5355\u63d0\u4ea4<\/strong><\/span><\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; color: #ff0000 !important;\">&lt;script <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">type<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;text\/javascript&#8221;<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">listenEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">eventObj<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">eventHandler<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">eventObj<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">addEventListener<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">eventObj<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">addEventListener<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">eventHandler<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">false<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">eventObj<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">attachEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;on&#8221;<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> + <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">eventObj<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">attachEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">eventHandler<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">eventObj<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">[<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;on&#8221;<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> + <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">]<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">eventHandler<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">cancelEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">preventDefault<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">preventDefault<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">();<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/w3c<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">returnValue<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">true<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/IE<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">onload<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">()<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">var<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">form<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">forms<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">[<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;picker&#8221;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">];<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">listenEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">form<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;submit&#8221;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">validateFields<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">};<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">validateFields<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">?<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> : <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">&#8230;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">invalid<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">cancelEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #ff0000 !important;\">&lt;\/script&gt;<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>\u786e\u5b9a\u6d4f\u89c8\u5668\u7a97\u53e3\u7684\u5c3a\u5bf8<\/strong><\/span><\/p>\n<p style=\"color: #3e3e3e;\">\u5bf9\u4e8e\u4e3b\u6d41\u6d4f\u89c8\u5668\u6765\u8bf4\uff0c\u6bd4\u5982IE9\u3001Firefox\uff0cChrome\u548cSafari\uff0c\u652f\u6301\u540d\u4e3ainnerWidth \u548c innerHeight\u7684\u7a97\u53e3\u5bf9\u8c61\u5c5e\u6027\uff0c\u5b83\u8fd4\u56de\u7a97\u53e3\u7684\u89c6\u53e3\u533a\u57df\uff0c\u51cf\u53bb\u4efb\u4f55\u6eda\u52a8\u6761\u7684\u5927\u5c0f\u3002IE\u4e0d\u652f\u6301innerWidth \u548c innerHeight<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; color: #ff0000 !important;\">&lt;script <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">type<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;text\/javascript&#8221;<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">size<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">var<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">w<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #009999 !important;\">0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">h<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #009999 !important;\">0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">!<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">innerWidth<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">w<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">documentElement<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important;\">clientWidth<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">?<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">documentElement<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">clientWidth<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> : <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">body<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">clientWidth<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">h<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">documentElement<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important;\">clientHeight<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">?<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">documentElement<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">clientHeight<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> : <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">body<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">clientHeight<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">w<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">innerWidth<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">h<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">innerHeight<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">return<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">width<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">:<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">w<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">height<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">:<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">h<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">};<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">console<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">log<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">size<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">());<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/Object { width: 1366, height: 633 }<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #ff0000 !important;\">&lt;\/script&gt;<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\">\u5b9e\u7528\u7684 JavaScript \u65b9\u6848\uff08\u6db5\u76d6\u6240\u6709\u6d4f\u89c8\u5668\uff09\uff1a<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: bold !important; color: #800080 !important;\">var<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">w<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">innerWidth<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> || <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">documentElement<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">clientWidth<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> || <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">body<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">clientWidth<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: bold !important; color: #800080 !important;\">var<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">h<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">innerHeight<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> || <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">documentElement<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">clientHeight<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">|| <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">body<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">clientHeight<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\">\u5bf9\u4e8e IE 6\u30017\u30018\u7684\u65b9\u6848\u5982\u4e0b\uff1a<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">documentElement<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">clientHeight<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">documentElement<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">clientWidth<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\">\u6216\u8005<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">body<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">clientHeight<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">body<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">clientWidth<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\">Document\u5bf9\u8c61\u7684body\u5c5e\u6027\u5bf9\u5e94HTML\u6587\u6863\u7684&lt;body&gt;\u6807\u7b7e\u3002Document\u5bf9\u8c61\u7684documentElement\u5c5e\u6027\u5219\u8868\u793a HTML\u6587\u6863\u7684\u6839\u8282\u70b9\u3002<\/p>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>attributes \u5c5e\u6027<\/strong><\/span><\/p>\n<p style=\"color: #3e3e3e;\">attributes \u5c5e\u6027\u8fd4\u56de\u8be5\u8282\u70b9\u7684\u5c5e\u6027\u8282\u70b9\u96c6\u5408\u3002<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">attributes<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/NamedNodeMap<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">attributes<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">length<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u8fd4\u56de\u5c5e\u6027\u8282\u70b9\u4e2a\u6570<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">attributes<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">[<\/span><span style=\"font-weight: inherit !important; color: #009999 !important;\">0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">];<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/Attr\uff0c\u8fd4\u56de\u6700\u540e\u4e00\u4e2a\u5c5e\u6027\u8282\u70b9<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">attributes<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">[<\/span><span style=\"font-weight: inherit !important; color: #009999 !important;\">0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">].<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">nodeType<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/2\uff0c\u8282\u70b9\u7c7b\u578b<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">attributes<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">[<\/span><span style=\"font-weight: inherit !important; color: #009999 !important;\">0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">].<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">nodeValue<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u5c5e\u6027\u503c<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">attributes<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">[<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;id&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">];<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/Attr\uff0c\u8fd4\u56de\u5c5e\u6027\u4e3a id \u7684\u8282\u70b9<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">attributes<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getNamedItem<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;id&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/Attr<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\"><strong>setAttribute \u548c getAttribute<\/strong><\/p>\n<p style=\"color: #3e3e3e;\">\u5728IE\u4e2d\u662f\u4e0d\u8ba4\u8bc6class\u5c5e\u6027\u7684\uff0c\u9700\u6539\u4e3aclassName\u5c5e\u6027\uff0c\u540c\u6837\uff0c\u5728Firefox\u4e2d\uff0c\u4e5f\u662f\u4e0d\u8ba4\u8bc6className\u5c5e\u6027\u7684\uff0cFirefox\u53ea\u8ba4\u8bc6class\u5c5e\u6027\uff0c\u6240\u4ee5\u901a\u5e38\u505a\u6cd5\u5982\u4e0b\uff1a<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">element<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">setAttribute<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">class<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">value<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/for firefox<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">element<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">setAttribute<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">className<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">value<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/for IE<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\">IE\uff1a\u53ef\u4ee5\u4f7f\u7528\u83b7\u53d6\u5e38\u89c4\u5c5e\u6027\u7684\u65b9\u6cd5\u6765\u83b7\u53d6\u81ea\u5b9a\u4e49\u5c5e\u6027,\u4e5f\u53ef\u4ee5\u4f7f\u7528getAttribute()\u83b7\u53d6\u81ea\u5b9a\u4e49\u5c5e\u6027<\/p>\n<p style=\"color: #3e3e3e;\">Firefox\uff1a\u53ea\u80fd\u4f7f\u7528getAttribute()\u83b7\u53d6\u81ea\u5b9a\u4e49\u5c5e\u6027.<\/p>\n<p style=\"color: #3e3e3e;\">\u89e3\u51b3\u65b9\u6cd5\uff1a\u7edf\u4e00\u901a\u8fc7getAttribute()\u83b7\u53d6\u81ea\u5b9a\u4e49\u5c5e\u6027<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getAttribute<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;id&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u83b7\u53d6\u5143\u7d20\u7684 id \u503c<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">id<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u83b7\u53d6\u5143\u7d20\u7684 id \u503c<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getAttribute<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;mydiv&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u83b7\u53d6\u5143\u7d20\u7684\u81ea\u5b9a\u4e49\u5c5e\u6027\u503c<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">mydiv<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u83b7\u53d6\u5143\u7d20\u7684\u81ea\u5b9a\u4e49\u5c5e\u6027\u503c\uff0c IE \u4e0d\u652f\u6301\u975e<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getAttribute<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;class&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u83b7\u53d6\u5143\u7d20\u7684 class \u503c\uff0cIE \u4e0d\u652f\u6301<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getAttribute<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;className&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u975e IE \u4e0d\u652f\u6301<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\">PS\uff1a\u5728 IE7 \u53ca\u66f4\u4f4e\u7248\u672c\u7684IE\u6d4f\u89c8\u5668\u4e2d\uff0c\u4f7f\u7528 setAttribute()\u65b9\u6cd5\u8bbe\u7f6e class \u548c style \u5c5e\u6027\u662f\u6ca1\u6709\u6548\u679c\u7684\uff0c\u867d\u7136 IE8 \u89e3\u51b3\u4e86\u8fd9\u4e2abug\uff0c\u4f46\u8fd8\u662f\u4e0d\u5efa\u8bae\u4f7f\u7528\u3002<\/p>\n<p style=\"color: #3e3e3e;\"><strong>removeAttribute()\u65b9\u6cd5<\/strong><\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; color: teal !important;\">removeAttribute<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">()<\/span>\u53ef\u4ee5\u79fb\u9664<span style=\"font-weight: inherit !important;\">HTML<\/span>\u5c5e\u6027\u3002<\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;box&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">removeAttribute<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;style&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u79fb\u9664\u5c5e\u6027<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\">PS\uff1aIE6 \u53ca\u66f4\u4f4e\u7248\u672c\u4e0d\u652f\u6301 removeAttribute()\u65b9\u6cd5\u3002<\/p>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>\u8de8\u6d4f\u89c8\u5668\u4e8b\u4ef6Event\u5bf9\u8c61<\/strong><\/span><\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; font-style: italic; color: #666666 !important;\">&lt;!doctype html&gt;<\/span><\/p>\n<p><span style=\"font-weight: bold !important;\">&lt;html <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">lang<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;en&#8221;<\/span><span style=\"font-weight: bold !important;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: bold !important;\">&lt;head&gt;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">&lt;meta <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">charset<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;UTF-8&#8221;<\/span><span style=\"font-weight: bold !important;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">&lt;title&gt;<\/span><span style=\"font-weight: inherit !important;\">Document<\/span><span style=\"font-weight: bold !important;\">&lt;\/title&gt;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important;\">\u00a0\u00a0\u00a0\u00a0<span style=\"font-weight: inherit !important; color: #ff0000 !important;\">&lt;style <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">type=&#8221;text\/css&#8221;&gt;<\/span><\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: teal !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #drop<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">width<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">300px<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">height<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">200px<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">background-color<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">#ff0000<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">padding<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">5px<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">border<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">2px<\/span><span style=\"font-weight: inherit !important;\">solid<\/span><span style=\"font-weight: inherit !important;\">#000000<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">#item<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">width<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">100px<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">height<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">100px<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">background-color<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">#ffff00<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">padding<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">5px<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">margin<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">20px<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">border<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">1px<\/span><span style=\"font-weight: inherit !important;\">dashed<\/span><span style=\"font-weight: inherit !important;\">black<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">*[draggable = true]<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">-moz-user-select<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">none<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">-webkit-user-select<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">none<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">cursor<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">:<\/span><span style=\"font-weight: inherit !important;\">move<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #ff0000 !important;\">&lt;\/style&gt;<\/span><\/p>\n<p><span style=\"font-weight: bold !important;\">&lt;\/head&gt;<\/span><\/p>\n<p><span style=\"font-weight: bold !important;\">&lt;body&gt;<\/span><\/p>\n<p><span style=\"font-weight: bold !important;\">&lt;div&gt;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">&lt;p&gt;<\/span><span style=\"font-weight: inherit !important;\">\u5c06\u91d1\u9ec4\u8272\u7684\u5c0f\u65b9\u5757\u62d6\u5230\u7ea2\u8272\u7684\u5927\u65b9\u5757\u4e2d\uff0c\u4e0d\u517c\u5bb9IE7\u53ca\u4ee5\u4e0b\u6d4f\u89c8\u5668\uff0c\u517c\u5bb9\u4e3b\u6d41\u6d4f\u89c8\u5668\uff01<\/span><span style=\"font-weight: bold !important;\">&lt;\/p&gt;<\/span><\/p>\n<p><span style=\"font-weight: bold !important;\">&lt;\/div&gt;<\/span><\/p>\n<p><span style=\"font-weight: bold !important;\">&lt;div <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">id<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;item&#8221;<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">draggable<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;true&#8221;<\/span><span style=\"font-weight: bold !important;\">&gt;&lt;\/div&gt;<\/span><\/p>\n<p><span style=\"font-weight: bold !important;\">&lt;div <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">id<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;drop&#8221;<\/span><span style=\"font-weight: bold !important;\">&gt;&lt;\/div&gt;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important;\"><span style=\"font-weight: inherit !important; color: #ff0000 !important;\">&lt;script <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">type<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;text\/javascript&#8221;<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">&gt;<\/span><\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">listenEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">type<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">handler<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">addEventListener<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/w3c<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">addEventListener<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">type<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">handler<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">false<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">attachEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/IE<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">type<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;on&#8221;<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> + <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">type<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">attachEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">type<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">handler<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/IE<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">[<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;on&#8221;<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> + <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">type<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">]<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">handler<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u53d6\u6d88\u4e8b\u4ef6<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">cancelEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">e<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">e<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">preventDefault<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">e<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">preventDefault<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">();<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/w3c<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">e<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">returnValue<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">false<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/IE<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u53d6\u6d88\u4f20\u9012<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">cancelPropagation<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">e<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">e<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">stopPropagation<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">e<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">stopPropagation<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">();<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/w3c<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">e<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">cancelBubble<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">true<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/IE<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">onload<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">()<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">var<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;drop&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">listenEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;dragenter&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">cancelEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">listenEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;dragover&#8221;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">dragOver<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">listenEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;drop&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">)<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">cancelPropagation<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> || <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">dataTransfer<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">dropEffect<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;copy&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">var<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">id<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">dataTransfer<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getData<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;Text&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">appendChild<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">id<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">));<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">});<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">var<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">item<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;item&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">item<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">setAttribute<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;draggable&#8221;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;true&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">listenEvent<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">item<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;dragstart&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">)<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> || <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">dataTransfer<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">effectAllowed<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;copy&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">dataTransfer<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">setData<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;Text&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">item<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">id<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">});<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">};<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">dragOver<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">preventDefault<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">)<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">preventDefault<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">();<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> || <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">evt<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">dataTransfer<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">dropEffect<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;copy&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">return<\/span><span style=\"font-weight: bold !important; color: #800080 !important;\">false<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #ff0000 !important;\">&lt;\/script&gt;<\/span><\/p><\/blockquote>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: bold !important;\">&lt;\/body&gt;<\/span><\/p>\n<p><span style=\"font-weight: bold !important;\">&lt;\/html&gt;<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>dataTransfer \u5bf9\u8c61<\/strong><\/span><\/p>\n<p style=\"color: #3e3e3e;\">| \u5c5e\u6027 | \u63cf\u8ff0 |<\/p>\n<p style=\"color: #3e3e3e;\">| \u2014\u2014\u2014\u2014- |:\u2014\u2014\u2014\u2014-:|<\/p>\n<p style=\"color: #3e3e3e;\">| dropEffect | \u8bbe\u7f6e\u6216\u83b7\u53d6\u62d6\u66f3\u64cd\u4f5c\u7684\u7c7b\u578b\u548c\u8981\u663e\u793a\u7684\u5149\u6807\u7c7b\u578b |<\/p>\n<p style=\"color: #3e3e3e;\">| effectAllowed | \u8bbe\u7f6e\u6216\u83b7\u53d6\u6570\u636e\u4f20\u9001\u64cd\u4f5c\u53ef\u5e94\u7528\u4e8e\u8be5\u5bf9\u8c61\u7684\u6e90\u5143\u7d20 |<\/p>\n<p style=\"color: #3e3e3e;\">| \u65b9\u6cd5 | \u63cf\u8ff0 |<\/p>\n<p style=\"color: #3e3e3e;\">| \u2014\u2014\u2014\u2014- |:\u2014\u2014\u2014\u2014-:|<\/p>\n<p style=\"color: #3e3e3e;\">| clearData | \u901a\u8fc7 dataTransfer \u6216 clipboardData \u5bf9\u8c61\u4ece\u526a\u8d34\u677f\u5220\u9664\u4e00\u79cd\u6216\u591a\u79cd\u6570\u636e\u683c\u5f0f |<\/p>\n<p style=\"color: #3e3e3e;\">| getData | \u901a\u8fc7 dataTransfer \u6216 clipboardData \u5bf9\u8c61\u4ece\u526a\u8d34\u677f\u83b7\u53d6\u6307\u5b9a\u683c\u5f0f\u7684\u6570\u636e<\/p>\n<p style=\"color: #3e3e3e;\">| setData | \u4ee5\u6307\u5b9a\u683c\u5f0f\u7ed9 dataTransfer \u6216 clipboardData \u5bf9\u8c61\u8d4b\u4e88\u6570\u636e<\/p>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>HTML5\u62d6\u62fd\u7684\u6d4f\u89c8\u5668\u652f\u6301<\/strong><\/span><\/p>\n<p style=\"color: #3e3e3e;\">Internet Explorer 9\u3001Firefox\u3001Opera 12\u3001Chrome \u4ee5\u53ca Safari 5 \u652f\u6301\u62d6\u653e<\/p>\n<p style=\"color: #3e3e3e;\">\u4e3a\u4e86\u4f7f\u5143\u7d20\u53ef\u62d6\u52a8\uff0c\u9700\u628a draggable \u5c5e\u6027\u8bbe\u7f6e\u4e3a true \uff1a<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p>&lt;img draggable=&#8221;true&#8221; \/&gt;<\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\">| \u4e8b\u4ef6 | \u63cf\u8ff0 |<\/p>\n<p style=\"color: #3e3e3e;\">| \u2014\u2014\u2014\u2014- |:\u2014\u2014\u2014\u2014-:|<\/p>\n<p style=\"color: #3e3e3e;\">| dragstart | \u62d6\u62fd\u4e8b\u4ef6\u5f00\u59cb |<\/p>\n<p style=\"color: #3e3e3e;\">| drag | \u5728\u62d6\u52a8\u64cd\u4f5c\u4e0a |<\/p>\n<p style=\"color: #3e3e3e;\">| dragenter | \u62d6\u52a8\u5230\u76ee\u6807\u4e0a\uff0c\u7528\u6765\u51b3\u5b9a\u76ee\u6807\u662f\u5426\u63a5\u53d7\u653e\u7f6e<\/p>\n<p style=\"color: #3e3e3e;\">|dragover | \u62d6\u52a8\u5230\u76ee\u6807\u4e0a\uff0c\u7528\u6765\u51b3\u5b9a\u7ed9\u7528\u6237\u7684\u53cd\u9988<\/p>\n<p style=\"color: #3e3e3e;\">|drop | \u653e\u7f6e\u53d1\u751f<\/p>\n<p style=\"color: #3e3e3e;\">| dragleave| \u62d6\u52a8\u79bb\u5f00\u76ee\u6807<\/p>\n<p style=\"color: #3e3e3e;\">|dragend | \u62d6\u52a8\u64cd\u4f5c\u7ed3\u675f<\/p>\n<p style=\"color: #3e3e3e;\">\u4e0a\u8ff0\u4ee3\u7801\u7684\u4e00\u4e9b\u6d4f\u89c8\u5668\u517c\u5bb9\u6027\uff1a<\/p>\n<p style=\"color: #3e3e3e;\">1.\u4e3a\u4e86\u517c\u5bb9IE\uff0c\u6211\u4eec\u5c06`window.event`\u8d4b\u7ed9 `evt`\uff0c\u5176\u4ed6\u6d4f\u89c8\u5668\u5219\u4f1a\u6b63\u786e\u5c06\u63a5\u6536\u5230\u7684`event`\u5bf9\u8c61\u8d4b\u7ed9`evt`\u3002<\/p>\n<p style=\"color: #3e3e3e;\">2.w3c\u4f7f\u7528addEventListener\u6765\u4e3a\u4e8b\u4ef6\u5143\u7d20\u6dfb\u52a0\u4e8b\u4ef6\u76d1\u542c\u5668\uff0c\u800cIE\u5219\u4f7f\u7528attachEvent\u3002addEventListener\u4e3a\u4e8b\u4ef6\u5192\u6ce1\u5230\u7684\u5f53\u524d\u5bf9\u8c61\uff0c\u800cattachEvent\u662fwindow<\/p>\n<p style=\"color: #3e3e3e;\">3.\u5bf9\u4e8e\u4e8b\u4ef6\u7c7b\u578b\uff0cIE\u9700\u8981\u52a0`on + type`\u5c5e\u6027\uff0c\u800c\u5176\u4ed6\u6d4f\u89c8\u5668\u5219\u4e0d\u7528<\/p>\n<p style=\"color: #3e3e3e;\">4.\u5bf9\u4e8e\u963b\u6b62\u5143\u7d20\u7684\u9ed8\u8ba4\u4e8b\u4ef6\u884c\u4e3a\uff0c\u4e0b\u9762\u662fw3c\u548cIE\u7684\u505a\u6cd5\uff1a<\/p>\n<p style=\"color: #3e3e3e;\">\u00a0 \u00a0 e.preventDefault();\/\/w3c<\/p>\n<p style=\"color: #3e3e3e;\">\u00a0 \u00a0 e.returnValue = false;\/\/IE<\/p>\n<p style=\"color: #3e3e3e;\">5.\u5bf9\u4e8e\u53d6\u6d88\u4e8b\u4ef6\u4f20\u64ad\uff0cw3c\u548cIE\u4e5f\u6709\u4e0d\u540c\u7684\u5904\u7406\u673a\u5236\uff1a<\/p>\n<p style=\"color: #3e3e3e;\">\u00a0 \u00a0 e.stopPropagation();\/\/w3c<\/p>\n<p style=\"color: #3e3e3e;\">\u00a0 \u00a0 e.cancelBubble = true;\/\/IE<\/p>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>\u8de8\u6d4f\u89c8\u5668\u83b7\u53d6\u76ee\u6807\u5bf9\u8c61<\/strong><\/span><\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u8de8\u6d4f\u89c8\u5668\u83b7\u53d6\u76ee\u6807\u5bf9\u8c61<\/span><\/p>\n<p><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getTarget<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">ev<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">ev<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/w3c<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">return<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">ev<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">srcElement<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/IE<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">return<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">srcElement<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\">\u5bf9\u4e8e\u83b7\u53d6\u89e6\u53d1\u4e8b\u4ef6\u7684\u5bf9\u8c61\uff0cw3c\u548cIE\u4e5f\u6709\u4e0d\u540c\u7684\u505a\u6cd5\uff1a<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">target<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/w3c<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #002d7a !important;\">event<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">srcElement<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/IE<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\">\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e09\u76ee\u8fd0\u7b97\u7b26\u6765\u517c\u5bb9\u4ed6\u4eec\uff1a<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p>obj = event.srcElement ? event.srcElement : event.target;<\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>innerText\u7684\u95ee\u9898<\/strong><\/span><\/p>\n<p style=\"color: #3e3e3e;\">innerText\u5728IE\u4e2d\u80fd\u6b63\u5e38\u5de5\u4f5c\uff0c\u4f46\u662finnerText\u5728FireFox\u4e2d\u5374\u4e0d\u884c\u3002<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: bold !important;\">&lt;p <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">id<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;element&#8221;<\/span><span style=\"font-weight: bold !important;\">&gt;&lt;\/p&gt;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #ff0000 !important;\">&lt;script <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">type<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;text\/javascript&#8221;<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">navigator<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">appName<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">indexOf<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;Explorer&#8221;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">)<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> &gt;-<\/span><span style=\"font-weight: inherit !important; color: #009999 !important;\">1<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;element&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">innerText<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;my text&#8221;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getElementById<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;element&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">).<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">textContent<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;my text&#8221;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #ff0000 !important;\">&lt;\/script&gt;<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\"><strong>\u8de8\u6d4f\u89c8\u5668\u83b7\u53d6\u548c\u8bbe\u7f6einnerText<\/strong><\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u8de8\u6d4f\u89c8\u5668\u83b7\u53d6innerText<\/span><\/p>\n<p><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">getInnerText<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">element<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">return<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: bold !important;\">typeof<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">element<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">textContent<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> == <\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;string&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">)<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">?<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">element<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">textContent<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> : <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">element<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">innerText<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u8de8\u6d4f\u89c8\u5668\u8bbe\u7f6einnerText<\/span><\/p>\n<p><span style=\"font-weight: bold !important; color: #800080 !important;\">function<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">setInnerText<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">element<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">,<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">text<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: bold !important;\">typeof<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">element<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">textContent<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> == <\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8216;string&#8217;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">element<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">textContent<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">text<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">{<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">element<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">innerText<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">text<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\"><span style=\"font-weight: inherit !important; color: #333333 !important;\">\u00a0<\/span><\/p>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>oninput,onpropertychange,onchange\u7684\u7528\u6cd5<\/strong><\/span><\/p>\n<p style=\"color: #3e3e3e;\">onchange\u89e6\u53d1\u4e8b\u4ef6\u5fc5\u987b\u6ee1\u8db3\u4e24\u4e2a\u6761\u4ef6\uff1a<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important;\">a<\/span>\uff09\u5f53\u524d\u5bf9\u8c61\u5c5e\u6027\u6539\u53d8\uff0c\u5e76\u4e14\u662f\u7531\u952e\u76d8\u6216\u9f20\u6807\u4e8b\u4ef6\u6fc0\u53d1\u7684\uff08\u811a\u672c\u89e6\u53d1\u65e0\u6548\uff09<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: inherit !important;\">b<\/span>\uff09\u5f53\u524d\u5bf9\u8c61\u5931\u53bb\u7126\u70b9<span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">onblur<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">)<\/span>\uff1b<\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\">onpropertychange\u7684\u8bdd\uff0c\u53ea\u8981\u5f53\u524d\u5bf9\u8c61\u5c5e\u6027\u53d1\u751f\u6539\u53d8\uff0c\u90fd\u4f1a\u89e6\u53d1\u4e8b\u4ef6\uff0c\u4f46\u662f\u5b83\u662fIE\u4e13\u5c5e\u7684\uff1b<\/p>\n<p style=\"color: #3e3e3e;\">oninput\u662fonpropertychange\u7684\u975eIE\u6d4f\u89c8\u5668\u7248\u672c\uff0c\u652f\u6301firefox\u548copera\u7b49\u6d4f\u89c8\u5668\uff0c\u4f46\u6709\u4e00\u70b9\u4e0d\u540c\uff0c\u5b83\u7ed1\u5b9a\u4e8e\u5bf9\u8c61\u65f6\uff0c\u5e76\u975e\u8be5\u5bf9\u8c61\u6240\u6709\u5c5e\u6027\u6539\u53d8\u90fd\u80fd\u89e6\u53d1\u4e8b\u4ef6\uff0c\u5b83\u53ea\u5728\u5bf9\u8c61value\u503c\u53d1\u751f\u6539\u53d8\u65f6\u594f\u6548\u3002<\/p>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>\u8bbf\u95eeXMLHTTPRequest\u5bf9\u8c61<\/strong><\/span><\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; color: #ff0000 !important;\">&lt;script <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">type<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">=<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;text\/javascript&#8221;<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">XMLHttpRequest<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">xhr<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: bold !important;\">new<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">XMLHttpRequest<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">();<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u975eIE<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><span style=\"font-weight: bold !important;\">else<\/span><span style=\"font-weight: bold !important;\">if<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">window<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">ActiveXObject<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">){<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">xhr<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: bold !important;\">new<\/span><span style=\"font-weight: inherit !important; color: teal !important;\">ActiveXObject<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">(<\/span><span style=\"font-weight: inherit !important; color: #dd1144 !important;\">&#8220;Microsoft.XMLHttp&#8221;<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">);<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/IE<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #006fe0 !important;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">}<\/span><\/p>\n<p><span style=\"font-weight: inherit !important; color: #ff0000 !important;\">&lt;\/script&gt;<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>\u7981\u6b62\u9009\u53d6\u7f51\u9875\u5185\u5bb9<\/strong><\/span><\/p>\n<p style=\"color: #3e3e3e;\">\u95ee\u9898\uff1a<\/p>\n<p style=\"color: #3e3e3e;\">FF\u9700\u8981\u7528CSS\u7981\u6b62\uff0cIE\u7528JS\u7981\u6b62<\/p>\n<p style=\"color: #3e3e3e;\">\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<p style=\"color: #3e3e3e;\">IE: obj.onselectstart = function() {return false;}<\/p>\n<p style=\"color: #3e3e3e;\">FF: -moz-user-select:none;<\/p>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>\u4e09\u5927\u4e0d\u5192\u6ce1\u4e8b\u4ef6<\/strong><\/span><\/p>\n<p style=\"color: #3e3e3e;\">\u6240\u6709\u6d4f\u89c8\u5668\u7684focus\/blur\u4e8b\u4ef6\u90fd\u4e0d\u5192\u6ce1\uff0c\u4e07\u5e78\u7684\u662f\u5927\u90e8\u5206\u6d4f\u89c8\u5668\u652f\u6301focusin\/focusout\u4e8b\u4ef6\uff0c\u4e0d\u8fc7\u53ef\u6076\u7684firefox\u8fde\u8fd9\u4e2a\u90fd\u4e0d\u652f\u6301\u3002<\/p>\n<p style=\"color: #3e3e3e;\">IE6\u30017\u30018\u4e0b submit\u4e8b\u4ef6\u4e0d\u5192\u6ce1\u3002<\/p>\n<p style=\"color: #3e3e3e;\">IE6\u30017\u30018\u4e0b change\u4e8b\u4ef6\u8981\u7b49\u5230blur\u65f6\u624d\u89e6\u53d1\u3002<\/p>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>\u4e07\u6076\u7684\u6eda\u8f6e\u4e8b\u4ef6<\/strong><\/span><\/p>\n<p style=\"color: #3e3e3e;\">\u6eda\u8f6e\u4e8b\u4ef6\u7684\u652f\u6301\u53ef\u8c13\u662f\u4e71\u4e03\u516b\u7cdf\uff0c\u89c4\u5f8b\u5982\u4e0b\uff1a<\/p>\n<blockquote style=\"color: #3e3e3e;\"><p>IE6-11 chrome mousewheel wheelDetla \u4e0b -120 \u4e0a 120<\/p>\n<p>&nbsp;<\/p>\n<p>firefox DOMMouseScroll detail \u4e0b3 \u4e0a-3<\/p>\n<p>&nbsp;<\/p>\n<p>firefox wheel detlaY \u4e0b3 \u4e0a-3<\/p>\n<p>&nbsp;<\/p>\n<p>IE9-11 wheel deltaY \u4e0b40 \u4e0a-40<\/p>\n<p>&nbsp;<\/p>\n<p>chrome wheel deltaY \u4e0b100 \u4e0a-100<\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\">\u5173\u4e8e\u9f20\u6807\u6eda\u8f6e\u4e8b\u4ef6\uff0cIE\u652f\u6301mousewheel\uff0c\u706b\u72d0\u652f\u6301DOMMouseScroll\u3002<\/p>\n<p style=\"color: #3e3e3e;\">\u5224\u65ad\u9f20\u6807\u6eda\u8f6e\u662f\u5411\u4e0a\u8fd8\u662f\u5411\u4e0b\uff0cIE\u662f\u901a\u8fc7wheelDelta\u5c5e\u6027\uff0c\u800c\u706b\u72d0\u662f\u901a\u8fc7detail\u5c5e\u6027<\/p>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>\u4e8b\u4ef6\u59d4\u6258\u65b9\u6cd5<\/strong><\/span><\/p>\n<blockquote style=\"color: #3e3e3e;\"><p><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/\u4e8b\u4ef6\u59d4\u6258\u65b9\u6cd5\u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-weight: inherit !important;\">IE<\/span>\uff1a<span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">body<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">onload<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">inject<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">;<\/span><span style=\"font-weight: inherit !important; font-style: italic !important; color: #999999 !important;\">\/\/Function inject()\u5728\u8fd9\u4e4b\u524d\u5df2\u88ab\u5b9e\u73b0\u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-weight: inherit !important;\">FF<\/span>\uff1a<span style=\"font-weight: inherit !important; color: #002d7a !important;\">document<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">body<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">.<\/span><span style=\"font-weight: inherit !important; color: #002d7a !important;\">onload<\/span><span style=\"font-weight: inherit !important; color: #006fe0 !important;\"> = <\/span><span style=\"font-weight: inherit !important; color: teal !important;\">inject<\/span><span style=\"font-weight: inherit !important; color: #333333 !important;\">();<\/span><\/p><\/blockquote>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>HTML5 \u7684\u6d4f\u89c8\u5668\u652f\u6301\u60c5\u51b5<\/strong><\/span><\/p>\n<p>\u00a0<a href=\"https:\/\/sdeno.com\/?attachment_id=5509\" rel=\"attachment wp-att-5509\"><figure class=\"mdx-lazyload-container\" style=\"max-width:643px\"><div style=\"padding-top:99.533437013997%\"><\/div><div class=\"mdx-img-loading-sp mdui-valign\"><div><div class=\"mdui-spinner\"><\/div><\/div><\/div><img width=\"643\" height=\"640\" class=\"alignnone size-full wp-image-5509 lazyload\" title=\"dom2\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" data-src=\"https:\/\/sdeno.com\/wp-content\/uploads\/2016\/11\/dom2.jpg\" alt=\"dom2\"><\/figure><\/a><\/p>\n<p>&nbsp;<\/p>\n<p style=\"color: #3e3e3e;\"><span style=\"color: #ff0000;\"><strong>\u67e5\u8be2\u64cd\u4f5c<\/strong><\/span><\/p>\n<p style=\"color: #3e3e3e;\">\n<p style=\"color: #3e3e3e;\">\u67e5\u8be2\u901a\u8fc7\u6307\u7684\u662f\u901a\u8fc7\u4e00\u4e9b\u7279\u5f81\u5b57\u7b26\u4e32\u6765\u627e\u5230\u4e00\u7ec4\u5143\u7d20\uff0c\u6216\u8005\u5224\u65ad\u5143\u7d20\u662f\u4e0d\u662f\u6ee1\u8db3\u5b57\u7b26\u4e32\u3002<\/p>\n<p style=\"color: #3e3e3e;\">\n<ol class=\"list-paddingleft-2\" style=\"color: #3e3e3e;\">\n<li>IE6\/7\u4e0d\u533a\u5206id\u548cnam\u5728IE6\/7\u4e0b\u4f7f\u7528getElementById\u548cgetElementsByName\u65f6\u4f1a\u540c\u65f6\u8fd4\u56deid\u6216name\u4e0e\u7ed9\u5b9a\u503c\u76f8\u540c\u7684\u5143\u7d20\u3002\u7531\u4e8ename\u901a\u5e38\u7531\u540e\u7aef\u7ea6\u5b9a\uff0c\u56e0\u6b64\u6211\u4eec\u5728\u5199JS\u65f6\uff0c\u5e94\u4fdd\u8bc1id\u4e0d\u4e0ename\u91cd\u590d\u3002<\/li>\n<li>IE6\/7\u4e0d\u652f\u6301getElementsByClassName\u548cquerySelectorAll \u8fd9\u4e24\u4e2a\u51fd\u6570\u4eceIE8\u5f00\u59cb\u652f\u6301\u7684\uff0c\u56e0\u6b64\u5728IE6\/7\u4e0b\uff0c\u6211\u4eec\u5b9e\u9645\u53ef\u4ee5\u7528\u7684\u53ea\u6709getElementByTagName\u3002<\/li>\n<li>IE6\/7\u4e0d\u652f\u6301getElementsByTagName(\u2018*\u2019)\u4f1a\u8fd4\u56de\u975e\u5143\u7d20\u8282\u70b9 \u8981\u4e48\u4e0d\u7528*\uff0c\u8981\u4e48\u81ea\u5df1\u5199\u4e2a\u51fd\u6570\u8fc7\u6ee4\u4e00\u4e0b\u3002<\/li>\n<li>IE8\u4e0bquerySelectorAll\u5bf9\u5c5e\u6027\u9009\u62e9\u5668\u4e0d\u53cb\u597d \u51e0\u4e4e\u6240\u6709\u6d4f\u89c8\u5668\u9884\u5b9a\u4e49\u7684\u5c5e\u6027\u90fd\u6709\u4e86\u95ee\u9898\uff0c\u5c3d\u91cf\u4f7f\u7528\u81ea\u5b9a\u4e49\u5c5e\u6027\u6216\u8005\u4e0d\u7528\u5c5e\u6027\u9009\u62e9\u5668\u3002<\/li>\n<li>IE8\u4e0bquerySelectorAll\u4e0d\u652f\u6301\u4f2a\u7c7b \u6709\u65f6\u5019\u4f2a\u7c7b\u662f\u5f88\u597d\u7528\uff0cIE8\u5e76\u4e0d\u652f\u6301\uff0cjquery\u63d0\u4f9b\u7684:first\u3001:last\u3001:even\u3001:odd\u3001:eq\u3001:nth\u3001:lt\u3001:gt\u5e76\u4e0d\u662f\u4f2a\u7c7b\uff0c\u6211\u4eec\u5728\u4efb\u4f55\u65f6\u95f4\u90fd\u4e0d\u8981\u4f7f\u7528\u5b83\u4eec\u3002<\/li>\n<li>IE9\u7684matches\u51fd\u6570\u4e0d\u80fd\u5904\u7406\u4e0d\u5728DOM\u6811\u4e0a\u7684\u5143\u7d20\u53ea\u8981\u5143\u7d20\u4e0d\u5728dom\u6811\u4e0a\uff0c\u4e00\u5b9a\u4f1a\u8fd4\u56defalse\uff0c\u5b9e\u5728\u4e0d\u884c\u628a\u5143\u7d20\u4e22\u5728body\u91cc\u9762\u5339\u914d\u5b8c\u4e86\u518d\u5220\u6389\u5427\uff0c\u5f53\u7136\u4e86\u6211\u4eec\u4e5f\u53ef\u4ee5\u81ea\u5df1\u5199\u5339\u914d\u51fd\u6570\u4ee5\u907f\u514d\u56de\u6d41\u3002<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzAxODE2MjM1MA==&amp;mid=2651551334&amp;idx=1&amp;sn=e44a6bf1ecc3736f196ff582208998a2&amp;chksm=8025a1a7b75228b17bf2596597b2347deca62b8b6ee43f9300410cb6cc2ac38aaa8d7117a0bf&amp;scene=0#wechat_redirect\" target=\"_blank\">\u00a0http:\/\/mp.weixin.qq.com\/s?__biz=MzAxODE2MjM1MA==&amp;mid=2651551334&amp;idx=1&amp;sn=e44a6bf1ecc3736f196ff582208998a2&amp;chksm=8025a1a7b75228b17bf2596597b2347deca62b8b6ee43f9300410cb6cc2ac38aaa8d7117a0bf&amp;scene=0#wechat_redirect<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000002650240\" target=\"_blank\">https:\/\/segmentfault.com\/a\/1190000002650240<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>js\u5728\u64cd\u4f5cDOM\u4e2d\u5b58\u5728\u7740\u8bb8\u591a\u8de8\u6d4f\u89c8\u5668\u65b9\u9762\u7684\u5751\uff0c\u672c\u6587\u82b1\u4e86\u6211\u5c06\u8fd1\u4e00\u5468\u7684\u65f6\u95f4\u6574\u7406\uff0c\u6211\u5c06\u6839\u636e\u5b9e\u4f8b\u6574\u7406\u90a3\u4e9b\u5927\u5927\u5c0f\u5c0f\u7684\u201c\u5751 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-5507","post","type-post","status-publish","format-standard","hentry","category-11"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/5507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5507"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/5507\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}