{"id":56,"date":"2024-08-27T12:14:35","date_gmt":"2024-08-27T09:14:35","guid":{"rendered":"https:\/\/planeta21vek.ru\/elina732\/?p=56"},"modified":"2025-11-20T20:43:39","modified_gmt":"2025-11-20T17:43:39","slug":"atribut-class","status":"publish","type":"post","link":"https:\/\/planeta21vek.ru\/elina732\/2024\/08\/27\/atribut-class\/","title":{"rendered":"\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 class"},"content":{"rendered":"<p style=\"text-align: justify;\">\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 class \u044d\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041a\u043b\u0430\u0441\u0441\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 CSS \u0438 Javascript \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043c\u0435\u0442\u043e\u0434\u044b DOM document.getElementsByClassName. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 class. \u041e\u043d \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u043d\u043e \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0438 \u043f\u0440\u043e\u0449\u0435 \u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p><!--more--><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-57\" src=\"https:\/\/planeta21vek.ru\/elina732\/wp-content\/uploads\/2024\/08\/class270824.png\" alt=\"\" width=\"667\" height=\"306\" srcset=\"https:\/\/planeta21vek.ru\/elina732\/wp-content\/uploads\/2024\/08\/class270824.png 667w, https:\/\/planeta21vek.ru\/elina732\/wp-content\/uploads\/2024\/08\/class270824-300x138.png 300w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><\/p>\n<p><span style=\"color: #993300;\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 1<\/strong><\/span><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;p class=&quot;note editorial&quot;&gt;Above point sounds a bit obvious. Remove\/rewrite?&lt;\/p&gt;\r\n&lt;p&gt;Narrator: I must warn you now folks that this beginning is very exciting.&lt;\/p&gt;\r\n&lt;p class=&quot;note&quot;&gt;&#x5B;Lights go up and wind blows; Caspian enters stage right]&lt;\/p&gt;\r\n<\/pre>\n<p>\u041e\u0434\u043d\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044f \u0438\u0445 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438.<\/p>\n\n<p><span style=\"color: #993300;\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 2<\/strong><\/span><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!-- \u041e\u0434\u0438\u043d \u043a\u043b\u0430\u0441\u0441 --&gt;\r\n&lt;div class=&quot;container&quot;&gt;\r\n&lt;!-- ... --&gt;\r\n&lt;\/div&gt;\r\n&lt;!-- \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432 --&gt;\r\n&lt;div class=&quot;container special-box&quot;&gt;\r\n&lt;!-- ... --&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<p><span style=\"color: #993300;\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 3<\/strong><\/span><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n.highlighted-text {\r\nbackground-color: yellow;\r\nfont-size: 18px;\r\n}&lt;\/pre&gt;\r\n&lt;span class=&quot;highlighted-text&quot;&gt;\u042d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d.&lt;\/span&gt;\r\n\r\n<\/pre>\n<p><span style=\"color: #993300;\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 4<\/strong><\/span><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nconst elements = document.querySelectorAll(&amp;#039;.clickable&amp;#039;);\r\nelements.forEach(element =&gt; {\r\nelement.addEventListener(&amp;#039;click&amp;#039;, () =&gt; {\r\nalert(&amp;#039;\u041a\u043b\u0438\u043a!&amp;#039;);\r\n});\r\n});\r\n\r\n&lt;button class=&quot;click&quot;&gt;\u0414\u0430\u043b\u0435\u0435&lt;\/button&gt;\r\n<\/pre>\n<p>\u0421\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b \u0432 CSS: \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 HTML-\u0442\u0435\u0433\u0443, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044f \u0432\u0441\u0435 \u0434\u0440\u0443\u0433\u0438\u0435.<\/p>\n<p><span style=\"color: #993300;\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 5<\/strong><\/span><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\/* \u0422\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 &lt;p&gt; \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c special-text *\/\r\np.special-text {\r\ncolor: blue;\r\n}\r\n\r\n&lt;p class=&quot;special-text&quot;&gt;\u042d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u0438\u043d\u0438\u043c.&lt;\/p&gt;\r\n&lt;div class=&quot;special-text&quot;&gt;\u0410 \u044d\u0442\u043e\u0442 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.&lt;\/div&gt;\r\n<\/pre>\n\n","protected":false},"excerpt":{"rendered":"<p>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 class \u044d\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041a\u043b\u0430\u0441\u0441\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 CSS \u0438 Javascript \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043c\u0435\u0442\u043e\u0434\u044b DOM document.getElementsByClassName. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 class. \u041e\u043d \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u043d\u043e \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0438 \u043f\u0440\u043e\u0449\u0435 \u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c.<\/p>\n","protected":false},"author":1,"featured_media":57,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,7],"tags":[15,16,13,17],"class_list":{"0":"post-56","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-htmlverstka","8":"category-programmirovanie","9":"tag-class","10":"tag-css","11":"tag-html","12":"tag-17"},"_links":{"self":[{"href":"https:\/\/planeta21vek.ru\/elina732\/wp-json\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/planeta21vek.ru\/elina732\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/planeta21vek.ru\/elina732\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/planeta21vek.ru\/elina732\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/planeta21vek.ru\/elina732\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":4,"href":"https:\/\/planeta21vek.ru\/elina732\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":313,"href":"https:\/\/planeta21vek.ru\/elina732\/wp-json\/wp\/v2\/posts\/56\/revisions\/313"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/planeta21vek.ru\/elina732\/wp-json\/wp\/v2\/media\/57"}],"wp:attachment":[{"href":"https:\/\/planeta21vek.ru\/elina732\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/planeta21vek.ru\/elina732\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/planeta21vek.ru\/elina732\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}