Lightweight interpreted programming language used for managing interactive elements in web applications.
Usage
In source code
<script type="text/javascript">
..JavaScript code..
</script>Load remote code
<script src="./script.js"></script>Frameworks
To increase efficiency one can use JavaScript frameworks that introduce libraries that make it simple to create common but advanced functionalities, e.g. user login and registration.
Some popular frameworks are:
- Angular
- React
- Vue
- jQuery
Examples
Change button text
The following code changes the text content of a button1 HTML element:
document.getElementById("button1").innerHTML = "Changed Text!";