{"id":165,"date":"2015-07-23T14:37:24","date_gmt":"2015-07-23T14:37:24","guid":{"rendered":"http:\/\/blog.arivisti.com\/?p=165"},"modified":"2015-07-23T15:12:54","modified_gmt":"2015-07-23T15:12:54","slug":"html-tags","status":"publish","type":"post","link":"https:\/\/blog.arivisti.com\/?p=165","title":{"rendered":"JavaScript Introduction"},"content":{"rendered":"<p>JavaScript is the most popular programming language in the world.<\/p>\n<p>This page contains some examples of what JavaScript can do.<\/p>\n<h1>JavaScript Can Change HTML Content<\/h1>\n<p>One of many HTML methods is getElementById().<\/p>\n<p>This example uses the method to &#8220;find&#8221; an HTML element (with id=&#8221;demo&#8221;), and changes the element content (innerHTML) to &#8220;Hello JavaScript&#8221;:<\/p>\n<p><strong>Example:<\/strong><\/p>\n<blockquote><p>document.getElementById(&#8220;demo&#8221;).innerHTML = &#8220;Hello JavaScript&#8221;;<\/p><\/blockquote>\n<p><!DOCTYPE html><br \/>\n<html><br \/>\n<body><\/p>\n<h1>JavaScript Can Change Images<\/p>\n<h1>\n<p><img loading=\"lazy\" decoding=\"async\" id=\"myImage\" onclick=\"changeImage()\" src=\"http:\/\/blog.arivisti.com\/wp-content\/uploads\/2015\/07\/pic_bulboff.gif\" width=\"100\" height=\"180\"><\/p>\n<p><em>Click the light bulb to turn on\/off the light.<\/em><\/p>\n<p><script>\nfunction changeImage() {\n    var image = document.getElementById('myImage');\n    if (image.src.match(\"bulbon\")) {\n        image.src = \"http:\/\/blog.arivisti.com\/wp-content\/uploads\/2015\/07\/pic_bulboff.gif\";\n    } else {\n        image.src = \"http:\/\/blog.arivisti.com\/wp-content\/uploads\/2015\/07\/pic_bulbon.gif\";\n    }\n}\n<\/script><\/p>\n<p><\/body><br \/>\n<\/html><\/p>\n<h1>JavaScript Can Change HTML Styles (CSS)<\/h1>\n<p>Changing the style of an HTML element, is a variant of changing an HTML attribute:<\/p>\n<p><strong>Example:<\/strong><\/p>\n<blockquote><p>document.getElementById(&#8220;demo&#8221;).style.fontSize = &#8220;25px&#8221;;<\/p><\/blockquote>\n<h1>Did You Know?<\/h1>\n<blockquote><p>Note: JavaScript and Java are completely different languages, both in concept and design.<br \/>\nJavaScript was invented by Brendan Eich in 1995, and became an ECMA standard in 1997.<br \/>\nECMA-262 is the official name. ECMAScript 5 (JavaScript 1.8.5 &#8211; July 2010) is the current standard.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript is the most popular programming language in the world. This page contains some examples of what JavaScript can do. JavaScript Can Change HTML Content One of many HTML methods is getElementById(). This example uses the method to &#8220;find&#8221; an &hellip; <a href=\"https:\/\/blog.arivisti.com\/?p=165\"><\/p>\n<div class=\"readm\">Read More \u27e9 <\/div>\n<p><\/a><\/p>\n","protected":false},"author":1,"featured_media":173,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[10,11],"class_list":["post-165","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-design","tag-html-tags","tag-javascript-introduction"],"_links":{"self":[{"href":"https:\/\/blog.arivisti.com\/index.php?rest_route=\/wp\/v2\/posts\/165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.arivisti.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.arivisti.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.arivisti.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.arivisti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=165"}],"version-history":[{"count":17,"href":"https:\/\/blog.arivisti.com\/index.php?rest_route=\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":186,"href":"https:\/\/blog.arivisti.com\/index.php?rest_route=\/wp\/v2\/posts\/165\/revisions\/186"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.arivisti.com\/index.php?rest_route=\/wp\/v2\/media\/173"}],"wp:attachment":[{"href":"https:\/\/blog.arivisti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.arivisti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.arivisti.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}