Blog 4 - JavaScript
What is JavaScript?
JavaScript is a dynamic programming language that's used for a variety of purposes, including web development, web apps, game creation, and more. It enables you to add dynamic features to web sites that you couldn't achieve with only HTML and CSS. In way, that makes JavaScript the final piece of the puzzle when creating HTML pages.
For accomplishing dynamic tasks on the web, several browsers employ JavaScript as a scripting language. You can notice the impacts of JavaScript when you see a click-to-show dropdown menu, extra content added to a website, and dynamically changing element colors on a page, to mention a few things.
JavaScript's Dynamic Capabilities
The structure of your online document, as well as the content within it, is defined by HTML. CSS specifies different styles for the contents of a web document. JavaScript, on the other hand, is a dynamic programming language that enables Math computations, dynamically adds HTML material to the DOM, makes dynamic style declarations, and retrieves content from another website, among other things.
How is JavaScript used with HTML?
Just like CSS, which can either be it's own individual file (ex: styles.css) or internally within an HTML document itself and be placed under the script tag. With the use of JavaScript it expands the capabilities and creativity that can be down on your web page. Some common uses for JavaScript within an HTML file are for image manipulation, form validation, and dynamic changes of content. An example of what you can do with JavaScript, which I actually used for my blog homepage was using JavaScript to work alongside the music that plays in the background of my blog. The reason I had chosen to do this was because the music that played on the background of my blog would be too loud, and could not be adjusted by the user. To get around that, I placed a JavaScript that would take that audio and play it at a lower volume, so that the music wouldn't blast the users ears upon entering the site.