{"id":5608,"date":"2023-08-19T15:22:43","date_gmt":"2023-08-19T12:22:43","guid":{"rendered":"https:\/\/1.cbm.ua\/?p=5608"},"modified":"2024-06-23T10:44:57","modified_gmt":"2024-06-23T07:44:57","slug":"%d0%bf%d1%80%d0%b8%d0%bc%d0%b5%d1%80-%d0%bf%d1%80%d0%be%d0%b3%d1%80%d0%b0%d0%bc%d0%bc%d1%8b-%d0%bd%d0%b0-javascript-%d0%ba%d0%be%d1%82%d0%be%d1%80%d0%b0%d1%8f-%d0%bc%d0%b5%d0%bd%d1%8f%d0%b5%d1%82","status":"publish","type":"post","link":"https:\/\/1.cbm.ua\/?p=5608","title":{"rendered":"\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 JavaScript \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u0435\u043d\u044f\u0435\u0442 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 &#171;\u043b\u0430\u043c\u043f\u043e\u0447\u043a\u0443&#187; \u0438 \u0442\u0435\u043a\u0441\u0442."},"content":{"rendered":"\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/www.w3schools.com\/js\/js_intro.asp\" target=\"_blank\">URL \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u21161.<\/a><br><a rel=\"noreferrer noopener\" href=\"https:\/\/www.w3schools.com\/js\/tryit.asp?filename=tryjs_intro_lightbulb\" data-type=\"link\" data-id=\"https:\/\/www.w3schools.com\/js\/js_intro.asp\" target=\"_blank\">URL \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u21162.<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2023\/08\/image-6.png\" alt=\"\" class=\"wp-image-5609\" style=\"width:192px;height:259px\" width=\"192\" height=\"259\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"72\" height=\"120\" src=\"https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2023\/08\/image-7.png\" alt=\"\" class=\"wp-image-5610\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"69\" height=\"119\" src=\"https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2023\/08\/image-8.png\" alt=\"\" class=\"wp-image-5611\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><img decoding=\"async\" src=\"https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2023\/08\/image-7.png\" alt=\"\"><\/td><td><img decoding=\"async\" src=\"https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2023\/08\/image-8.png\" alt=\"\"><\/td><td>&#8212;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<!DOCTYPE html>\n<html>\n<body>\n\n<h2>What Can JavaScript Do?<\/h2>\n\n<p>JavaScript can change HTML attribute values.<\/p>\n\n<p>In this case JavaScript changes the value of the src (source)\n<br>\n attribute of an image and the content of a text element.<\/p>\n\n<button onclick=\"changeImageAndText('https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2023\/08\/image-8.png', 'On')\">Turn on the light<\/button>\n\n<button onclick=\"changeImageAndText('https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2023\/08\/image-7.png', 'Off')\">Turn off the light<\/button>\n<br>\n\n<img decoding=\"async\" id=\"myImage\" src=\"https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2023\/08\/image-7.png\" style=\"width:100px\">\n<p id=\"myText\">Off<\/p>\n<br>\n\n\n<script>\nfunction changeImageAndText(imageSrc, newText) {\n    document.getElementById('myImage').src = imageSrc;\n    document.getElementById('myText').textContent = newText;\n}\n<\/script>\n\n<\/body>\n<\/html>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!DOCTYPE html>\n&lt;html>\n&lt;body>\n\n&lt;h2>What Can JavaScript Do?&lt;\/h2>\n\n&lt;p>JavaScript can change HTML attribute values.&lt;\/p>\n\n&lt;p>In this case JavaScript changes the value of the src (source)\n&lt;br>\n attribute of an image and the content of a text element.&lt;\/p>\n\n&lt;button onclick=\"changeImageAndText('https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2023\/08\/image-8.png', 'On')\">Turn on the light&lt;\/button>\n\n&lt;button onclick=\"changeImageAndText('https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2023\/08\/image-7.png', 'Off')\">Turn off the light&lt;\/button>\n&lt;br>\n\n&lt;img id=\"myImage\" src=\"https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2023\/08\/image-7.png\" style=\"width:100px\">\n&lt;p id=\"myText\">Off&lt;\/p>\n&lt;br>\n\n\n&lt;script>\nfunction changeImageAndText(imageSrc, newText) {\n    document.getElementById('myImage').src = imageSrc;\n    document.getElementById('myText').textContent = newText;\n}\n&lt;\/script>\n\n&lt;\/body>\n&lt;\/html><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>URL \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u21161.URL \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u21162. &#8212; What Can JavaScript Do? JavaScript can change HTML attribute values. In this case JavaScript changes the value of the src (source) attribute of an image and the content of a text element. Turn on the light Turn off the light Off<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[163,6,110],"tags":[],"class_list":["post-5608","post","type-post","status-publish","format-standard","hentry","category--life-hack-life-hack","category-js","category-110"],"_links":{"self":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts\/5608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5608"}],"version-history":[{"count":7,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts\/5608\/revisions"}],"predecessor-version":[{"id":5937,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts\/5608\/revisions\/5937"}],"wp:attachment":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}