{"id":306071,"date":"2020-06-28T21:01:24","date_gmt":"2020-06-28T21:01:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=306071"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=306071","title":{"rendered":"\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e Javascript \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e \u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/508634\/\">\u042f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c, \u0438 \u0445\u043e\u0442\u044f \u0443\u0436\u0435 15 \u043b\u0435\u0442 \u043f\u0438\u0448\u0443 HTML\/CSS\/JS \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043d\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0431\u044b\u043b\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438. \u0411\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u044f \u043d\u0435 \u043f\u0438\u0448\u0443 \u043d\u0430 Javascript \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u0438\u0445 \u043b\u0435\u0442 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u0438 \u0447\u0430\u0441\u0442\u043e \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0451 \u0434\u0435\u043b\u0430\u044e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u041e\u0442\u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438! \u0414\u0435\u0441\u044f\u0442\u044c \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430 jQuery, \u0430 \u0433\u0434\u0435-\u0442\u043e \u0441 2017 \u0433\u043e\u0434\u0430 \u0434\u043b\u044f \u043c\u043e\u0438\u0445 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e vue.js (\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/jvns.ca\/blog\/2017\/06\/26\/vue-js-fun\/\" rel=\"nofollow\">\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0438\u0433\u0440\u0443 \u0442\u0438\u043f\u0430 \u00ab\u0441\u0430\u043f\u0451\u0440\u00bb<\/a>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0441\u0434\u0435\u043b\u0430\u043b\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u043a Vue).<\/p>\n<p>  \u041d\u043e \u043d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435, \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0437\u0430 \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 Javascript \u0431\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0432\u0435\u0441\u0435\u043b\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0445\u043e\u0442\u0435\u043b\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c!<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h1>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044f \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u043c Javascript<\/h1>\n<p>  \u041c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f Vue. \u041d\u043e \u043d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435, \u043a\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c <a href=\"https:\/\/questions.wizardzines.com\" rel=\"nofollow\">https:\/\/questions.wizardzines.com<\/a>, \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e \u2014 \u044f \u0445\u043e\u0442\u0435\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 HTML \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f PDF-\u0444\u0430\u0439\u043b\u0430 (\u0441 <a href=\"https:\/\/www.princexml.com\/\" rel=\"nofollow\">Prince<\/a>) \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>  \u042f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0432\u0438\u0434\u0435\u043b\u0430, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441 Vue (\u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e Vue \u0445\u043e\u0447\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0435\u0441\u044c HTML \u0441\u0430\u043c), \u0438 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u0431\u044b\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0442\u043e \u0440\u0435\u0448\u0438\u043b\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c Javascript \u0431\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e HTML\/CSS \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u0438\u043d <code>&lt;script src=&quot;js\/script.js&quot;&gt; &lt;\/script&gt;<\/code>.<\/p>\n<p>  \u042f \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u043b\u0430 \u0443\u0436\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0438 \u043f\u043e \u0445\u043e\u0434\u0443 \u0443\u0437\u043d\u0430\u043b\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0449\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0431\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u044f \u0434\u0443\u043c\u0430\u043b\u0430, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0430.<\/p>\n<h1>\u0414\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0451, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0438 \u0443\u0434\u0430\u043b\u044f\u044f CSS-\u043a\u043b\u0430\u0441\u0441\u044b<\/h1>\n<p>  \u042f \u0440\u0435\u0448\u0438\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0432\u0435\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043e\u044f\u044f \u0438 \u0443\u0434\u0430\u043b\u044f\u044f CSS-\u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f CSS-\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b, \u0435\u0441\u043b\u0438 \u044f \u0445\u043e\u0447\u0443 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434.<\/p>\n<p>  \u0412\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u0433\u0434\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 <code>next<\/code> \u0434\u043b\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>done<\/code> \u043a \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u0443 div.<\/p>\n<pre><code class=\"javascript\">div.querySelector('.next-question').onclick = function () {     show_next_row();     this.parentElement.parentElement.classList.add('done'); }<\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e. \u041c\u043e\u0439 CSS, \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0445\u0430\u043e\u0442\u0438\u0447\u043d\u044b\u0439, \u043d\u043e \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c.<\/p>\n<h1>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 CSS-\u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e .classList<\/h1>\n<p>  \u042f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: <code>x.className = 'new list of classes'<\/code>. \u0425\u043e\u0442\u044f \u044d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0433\u0440\u044f\u0437\u043d\u043e, \u0438 \u044f \u0437\u0430\u0434\u0430\u043b\u0430\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u0435\u0441\u0442\u044c \u043b\u0438 \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431. \u0418 \u043e\u043d \u0431\u044b\u043b!<\/p>\n<p>  CSS-\u043a\u043b\u0430\u0441\u0441\u044b \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">let x = document.querySelector('div'); x.classList.add('hi'); x.classList.remove('hi');<\/code><\/pre>\n<p>  <code>element.classList.remove('hi')<\/code> \u2014 \u044d\u0442\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0447\u0438\u0449\u0435, \u0447\u0435\u043c \u043c\u043e\u0439 \u043f\u0440\u0435\u0436\u043d\u0438\u0439 \u043c\u0435\u0442\u043e\u0434.<\/p>\n<h1>\u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e document.querySelectorAll<\/h1>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0437\u0443\u0447\u0430\u0442\u044c jQuery, \u043f\u043e\u043c\u043d\u044e, \u044f \u0434\u0443\u043c\u0430\u043b\u0430, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u0447\u0442\u043e-\u0442\u043e \u0432 DOM, \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c jQuery (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>$('.class')<\/code>). \u042f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u044d\u0442\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u0443\u0437\u043d\u0430\u043b\u0430, \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c <code>document.querySelectorAll('.some-class')<\/code>, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043d\u0438 \u043e\u0442 \u043a\u0430\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438!<\/p>\n<p>  \u041c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0431\u044b\u043b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d <code>querySelectorAll<\/code>. \u042f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0433\u0443\u0433\u043b\u0438\u043b\u0430, \u0438 \u043f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e Selectors API \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0433\u0434\u0435-\u0442\u043e \u043c\u0435\u0436\u0434\u0443 2008 \u0438 2013 \u0433\u043e\u0434\u0430\u043c\u0438 \u2014 \u044f \u043d\u0430\u0448\u043b\u0430 <a href=\"https:\/\/johnresig.com\/blog\/thoughts-on-queryselectorall\/\" rel=\"nofollow\">\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 \u0430\u0432\u0442\u043e\u0440\u0430 jQuery<\/a>, \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 2008 \u0433\u043e\u0434\u0443, \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0431\u043b\u043e\u0433\u0435 \u043e\u0442 2011 \u0433\u043e\u0434\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043a \u0442\u043e\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u043d \u0431\u044b\u043b \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445, \u0442\u0430\u043a \u0447\u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0435\u0433\u043e \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e, \u043a\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c jQuery, \u043d\u043e \u043e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0443\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u043e \ud83d\ude42<\/p>\n<h1>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 .innerHTML<\/h1>\n<p>  \u0412 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u044f \u0445\u043e\u0442\u0435\u043b\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c HTML-\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u043d\u043e\u043f\u043a\u0438. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 DOM \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>document.createElement<\/code> \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0432\u0441\u044c \u0441\u0432\u0435\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0443 \u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0430 <code>.innerHTML<\/code> \u0434\u043b\u044f \u043d\u0443\u0436\u043d\u043e\u0439 HTML-\u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"javascript\">  button.innerHTML = `&lt;i class=&quot;icon-lightbulb&quot;&gt;&lt;\/i&gt;I learned something!     &lt;object data=&quot;\/confetti.svg&quot; width=&quot;30&quot; height = &quot;30&quot;&gt; &lt;\/object&gt;     `;<\/code><\/pre>\n<p>  <\/p>\n<h1>\u041f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e .scrollIntoView<\/h1>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0437\u0430\u0431\u0430\u0432\u043d\u0430\u044f \u0432\u0435\u0449\u044c, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u0443\u0437\u043d\u0430\u043b\u0430,\u00a0\u2014 \u044d\u0442\u043e <code>.scrollIntoView<\/code>. \u042f \u0445\u043e\u0442\u0435\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0443 \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430, \u043a\u043e\u0433\u0434\u0430 \u043a\u0442\u043e-\u0442\u043e \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441\u00bb. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"javascript\">row.classList.add('revealed'); row.scrollIntoView({behavior: 'smooth', block: 'center'});<\/code><\/pre>\n<p>  <\/p>\n<h1>\u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0430\u043d\u0438\u043b\u044c\u043d\u043e\u0433\u043e JS: peekobot<\/h1>\n<p>  \u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 JS, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b\u0430 \u0445\u043e\u0440\u043e\u0448\u0435\u0439, \u2014 \u044d\u0442\u043e <a href=\"https:\/\/peekobot.github.io\/peekobot\/\" rel=\"nofollow\">peekobot<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0447\u0430\u0442-\u0431\u043e\u0442\u0430, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 100 \u0441\u0442\u0440\u043e\u043a JS\/CSS.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 <a href=\"https:\/\/github.com\/Peekobot\/peekobot\/blob\/master\/peekobot.js\" rel=\"nofollow\">\u0435\u0433\u043e Javascript<\/a>, \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u2014 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e <code>.classList.add<\/code>, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 DOM, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 <code>.querySelectorAll<\/code>.<\/p>\n<p>  \u0418\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 peekobot \u044f \u0443\u0437\u043d\u0430\u043b\u0430 \u043e\u0431 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Element\/closest\" rel=\"nofollow\">.closest<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043a\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0443. \u041f\u043e\u0445\u043e\u0436\u0435, \u044d\u0442\u043e \u0431\u044b\u043b \u0431\u044b \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 <code>.parentElement.parentElement<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0430 \u0432 \u0441\u0432\u043e\u0451\u043c Javascript, \u0447\u0442\u043e \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0445\u0440\u0443\u043f\u043a\u0438\u043c.<\/p>\n<h1>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 Javascript \u043c\u043e\u0436\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e\u0435!<\/h1>\n<p>  \u042f \u0431\u044b\u043b\u0430 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0430 \u0442\u0435\u043c, \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e JS. \u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0430 \u043e\u043a\u043e\u043b\u043e 50 \u0441\u0442\u0440\u043e\u043a JS, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u0430\u043b\u0438 \u0432\u0441\u0451, \u0447\u0442\u043e \u044f \u0445\u043e\u0442\u0435\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0438 \u0435\u0449\u0451 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0431 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>  \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0441 \u043c\u043e\u0438\u043c\u0438 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u043f\u043e\u0441\u0442\u0430\u043c\u0438, \u044d\u0442\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u044b\u043c \u0441\u043e\u0432\u0435\u0442\u043e\u043c \u043f\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u041c\u043e\u044f \u0446\u0435\u043b\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u044b \u0441 \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c 200 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 Javascript, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442. \u0415\u0441\u043b\u0438 \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u0432\u0435\u0440\u0442\u0438\u0442\u0435\u0441\u044c \u0432 \u043c\u0438\u0440\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430, \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442!<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/508634\/\"> https:\/\/habr.com\/ru\/post\/508634\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/508634\/\">\u042f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c, \u0438 \u0445\u043e\u0442\u044f \u0443\u0436\u0435 15 \u043b\u0435\u0442 \u043f\u0438\u0448\u0443 HTML\/CSS\/JS \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043d\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0431\u044b\u043b\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438. \u0411\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u044f \u043d\u0435 \u043f\u0438\u0448\u0443 \u043d\u0430 Javascript \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u0438\u0445 \u043b\u0435\u0442 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u0438 \u0447\u0430\u0441\u0442\u043e \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0451 \u0434\u0435\u043b\u0430\u044e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u041e\u0442\u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438! \u0414\u0435\u0441\u044f\u0442\u044c \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430 jQuery, \u0430 \u0433\u0434\u0435-\u0442\u043e \u0441 2017 \u0433\u043e\u0434\u0430 \u0434\u043b\u044f \u043c\u043e\u0438\u0445 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e vue.js (\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/jvns.ca\/blog\/2017\/06\/26\/vue-js-fun\/\" rel=\"nofollow\">\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0438\u0433\u0440\u0443 \u0442\u0438\u043f\u0430 \u00ab\u0441\u0430\u043f\u0451\u0440\u00bb<\/a>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0441\u0434\u0435\u043b\u0430\u043b\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u043a Vue).<\/p>\n<p>  \u041d\u043e \u043d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435, \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0437\u0430 \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 Javascript \u0431\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0432\u0435\u0441\u0435\u043b\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0445\u043e\u0442\u0435\u043b\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c!  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-306071","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306071","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=306071"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306071\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}