Users visiting various web resources often come across interesting non-standard solutions and want to do the same on their sites. Most often, such solutions involve the use of JavaScript.

In this article, I'll tell you about JavaScript, a scripting language designed for creating interactive web pages, and what you can do with JS. We will look at examples using JavaScript and find out how it can be useful to us.

What can you do using JavaScript?

Edit the page, write text on it, add and remove tags, change element styles.

React to events: the script can wait for something to happen (mouse click/hover, page finishes loading) and respond by executing a function.
For example, when you hover your mouse over a link or image, you can show a tooltip. By clicking the mouse, you can switch the contents of the block. When the page loads, display an advertising pop-up window. Can be changed appearance pages depending on the time of day.

JavaScript. Fast start

Perform requests to the server and load data without reloading the page.
For example, if a user left a comment on a website or in a guest book, then this comment will be immediately displayed without reloading the page. You can also upload files to the server, showing the download progress as a percentage.

Set and read cookies, validate data, display messages and much more.
For example, when visiting a site for the first time, a pop-up window is shown to the user and a cookie is set. And on subsequent visits to this resource, the popup window is not shown because the cookies are already set.
You can also check the correctness of the entered e-mail, check for compliance the required format entered phone number and immediately display a message about the correctness or incorrectness of the entered data.

JavaScript Examples

The use of JavaScript is so wide and varied that thousands of examples of use can be given, and still the list will not be complete, because new scripts are written every day. I am sure that you have come across many of the examples below on various sites. And all this is implemented using JavaScript.

Of course, the gallery presented in the example is not the only one. There were hundreds of similar galleries, like everything else, that could be imagined. And in order not to inflate the list to infinity, I gave one example from the most popular groups of scripts.

What does this give us?

1. Convenient multi-level navigation

Using JavaScript allows you to make it compact multi-level menus, multi-level navigation in side-bars. Menu sub-items open either by clicking or by hovering the mouse.

Many online stores have a sidebar drop-down navigation. Let's take shop.by as an example. Imagine how much it would stretch down if the sub-items did not drop out on hover or click, but were visible all at once!

2. The use of galleries and sliders gives us the opportunity to show photographs, pictures of additional types of products, and conveniently and compactly arrange the photographer’s portfolio.

JavaScript. Fast start

Learn the basics of JavaScript at practical example on creating a web application

Galleries are especially relevant for detailed viewing of products in online stores, when you need to show different kinds goods. With their help, we can show the user all the images in a small block at once, providing both small and enlarged images for viewing.

How much space would be needed for the gallery shown in the picture below?

3. Lately, a lot of widgets have been displayed in the side columns of websites. These are popular widgets social networks, categories, post archives, calendars, latest comments on the blog, popular posts and much more.

It should be noted that on many sites, some widgets can simply be deleted, because they have no meaning and they take up space.

But what if you still need to compactly fit a lot of widgets?

This is where a JavaScript solution with “tabs” comes to the rescue.

With their help, you can fit all the widgets well in the side columns of the site. For better perception, you can group widgets into “tabs”.

For example, you can place social network widgets in one “tab”, categories and archives in the second, etc. This will save space and make the site more convenient to use.

4. Using JavaScript, you can also significantly improve the contact page for your site or your clients' sites.

embed tooltips in form fields;

check data entered into form fields and display error messages;

submit form data without reloading the page;

place a map with the route.

5. For those who place tabular data on the site, it will be very useful to use data sorting in the table.

6. Those who post any statistics on the site in the form of graphs and charts will find the ability to create interactive charts and graphs in JavaScript very useful.

Also, using JavaScript, you can create all sorts of effects on the site - such as smooth sliding of elements, their movement, gradual appearance and disappearance, and everything that your imagination can do.

All this can make the site more convenient for visitors, more interactive, and more technologically advanced.

Conclusion

As you can see, the scope of JavaScript is very wide. These include galleries, sliders, tabs, all sorts of interactive elements, maps, graphs, working with forms and much, much more.

I think that everyone can find useful uses for JavaScript and use it on their own sites or the sites of their clients.

I hope you liked the article and learned from it about new features that can be implemented thanks to JS.

Do you use JavaScript on your websites? What are your main challenges when using JavaScript?

Tell us about it in the comments to the article.

JavaScript. Fast start

Learn the basics of JavaScript with a hands-on example of how to create a web application.

The modern Internet is unthinkable without scripts. Learning to write in JavaScript.

If the Bible were written for the Internet, it would begin like this:

First there was mail. And the engineers saw that this was good. And they created WWW with hyperlinks. And the engineers saw that this was also good. And then they created the JavaScript language to bring pages to life.

This is roughly what happened in reality. JavaScript invented to “revive” HTML. Scripts JavaScript written directly into the text HTML or stored in separate files, like styles CSS. They are executed immediately after the page is loaded into the browser.

Even the language itself was at first called LiveScript. Then it was renamed to JavaScript, because they planned to somehow link it with the language general purpose Java. But now they have practically nothing in common, and JavaScript- a completely independent programming language with its own clear specification ECMAScript.

Formally, JavaScript is a trademark of Oracle, and this language is an “extension” of ECMAScript, along with JScript from Microsoft and ActionScript, but this is rather a concern of the owners brands. The main thing is that free ECMAScript does not belong to anyone.

Over time, sphere of influence JavaScript has expanded significantly. They began to use it not only for scripts on the page HTML, but also for serious large web applications and entire programs that run in the browser. There are tools to “package” these programs in a special way and run them separately from the browser. These are compilers and interpreters, which are discussed in more detail in the training courses "" and "".

JavaScript applications run in any environment that has an appropriate interpreter.

For now, we are only interested in browsers and HTML pages.

How to do JavaScript? Writing a basic script is no more difficult than writing a simple HTML- a page, because scripts JavaScript are written in plain text, that is, they can be created literally in the same Notepad, then saved in separate files or pasted into the body HTML-document. The simplest things on JavaScript are really easy to do.

How to Write JavaScript

For example, let's make a simple script for executing Windows scripts on the server. This script can be written directly in Notepad and executed without a browser.

WScript. echo(" Hello Skillbox!")

We write this text in "Notepad", then save the file under the name skillbox.js and run in "Explorer" Windows.

A similar script can be written directly in the page code HTML between tags And . There you can already use regular JavaScript methods, not a method echo specific object WScript. Let's look at some of the standard methods for input and output of data in the browser.

alert()

Method alert() displays a window with an “OK” button. The window displays a message indicated in parentheses. For example, “Hello, Skillbox!”. That is, in this case, the browser does exactly the same thing that the script server did before Windows.

These examples can also be written in Notepad, just saved in files with the extension HTML. For example, skillbox.htm.



alert(" Hello Skillbox")

Result:

As an argument alert() You can specify not only specific text, but also the result of any calculations or processing of other data. For example, alert(x), where x is calculated separately.

confirm()

Method confirm() displays the same window with a message, but with two buttons - “OK” and “Cancel”. Depending on which button the user clicks, the method returns either true, or false. The server receives this return value from the user and performs some action depending on the response.

The syntax is the same, only here a choice is logically assumed, so the user is asked a question.



confirm(" Hello Skillbox")

Result:

prompt()

Method prompt() displays a dialog box with a message and a text field where the user enters data. There are also two buttons “OK” and “Cancel”. When the first button is pressed, the method returns the entered text to the server, and when the second button is pressed, it returns boolean value false.

The syntax here is:

prompt( message, data_input_field_value)

The input field value is optional. There you can enter the text that was originally entered into the field for the convenience of the user.



prompt(" Say hi to Skillbox", "Hello")

Result:

Possibilities of modern JavaScript go far beyond primitive data input and output through forms. We have presented these methods only as the most simple examples. Besides, JavaScript allows you to respond to user actions. For example, on mouse movements or pressing certain keys. JavaScript often used to provide asynchronous operation ( Technology AJAX) when information on a page is updated without reloading it. In this mode, data is sent to the server and downloaded from there interactively. Besides, JavaScript able to manipulate HTML-elements on the page (create and hide tags, etc.) and do much more.

Useful Tools Developer Console

All popular browsers have a special developer console. It shows the script code on the page and also displays another useful information. IN Chrome, Firefox And I.E. developer console opens when clicked hotkey F12, V Safari - Ctrl+Shift+I or Ctrl+Alt+C. In the screenshot, the scripts are displayed at the top right, along with other elements of the web page.

Chrome Developer Console.

Code editors

In the future, for convenient programming, you will need to install a code editor or IDE (Integrated Development Environment), integrated development environment. IDE is an editor with advanced functionality that is integrated with other useful tools, supports connecting additional modules, and so on.

In this note I wanted to talk about why Javascript is needed and what you can do with it.

Like any programming language, the main task of Javascript is to create a sequence of actions that will lead to a specific result.

These can be “if-then” conditions, loops that create a certain sequence of actions, mathematical calculations, etc.

The most important thing is that all these operations can be performed on web pages, in a browser window. Moreover, javascript can work without an Internet connection.

So let's look at a number of examples that demonstrate the capabilities that can be achieved using Javascript. I have conditionally sorted them into several groups so that you have a certain understanding of what Javascript does and why it is needed.

1) Mathematical operations

On web pages, there is often a need to make certain calculations.

For example, there are two text fields and you need to display in the third text field the sum of two numbers that are entered in the first two.

Using Javascript, you can create a calculator and place it on a web page.

Here is an example of such a calculator:

Another situation, let’s take some text string on a web page, we need to increase its size by 1.5 times. This can also be done using mathematical calculations, by multiplying the current size by a factor of 1.5.

There are a lot of tasks that require calculations in practice. Javascript allows you to do all this.

2) Data processing in HTML forms without an Internet connection and without using server-side programming languages.

Javascript allows you to check that all required fields are filled in and that the data they contain matches the required format (for example, if numbers are required, then there should be only numbers and no letters).

Before sending data to the server, it is pre-checked in Javascript. This reduces the load on the server.

3) User interactions and events

Various effects may appear on a web page depending on what actions the user performs.

Drop-down menu on the site when hovering the mouse cursor.

When you click on a button, hide or show some element on the page.

A pop-up window appears when the mouse cursor moves outside the browser window.

Background dimming and element fade-in effects are implemented in Javascript.

4) Interact with HTML elements on the page and manipulate their content and styles.

When a certain event occurs (for example, a mouse click or any other), you can change the appearance ( CSS styles) elements on the page.

This is all done programmatically.

You can also add some HTML tags or attributes to them, also when a certain event occurs.

5) Adding animation and various graphic effects to web pages.

Falling and moving objects

Smooth appearance and hiding of objects

Countdown timer

And other effects are implemented in Javascript

I have listed here just a small list of Javascript features. So that you can see everything clearly and with real examples, here is a list of sites where working examples in javascript are published:

The capabilities and scope of Javascript are actually very extensive. Everything will be limited only by your imagination and creativity.

The Creative Bloq resource published material in which its authors shared with readers the best, in their opinion, examples of using JavaScript to create websites. The CPU selected the 30 most interesting resources.

1. Mike Kus Portfolio

Web designer Mike Kus's portfolio is designed in a "clean and understated style," write the editors at Creative Bloq. It combines large images with simple user interface elements.

“I think of my work as a brand. There is no need to add unnecessary design elements to my site,” says Kus.

Kus's portfolio is equally easy to navigate on all types of screens - he notes that this effect was the most difficult to achieve. Each of the designer's projects is represented by an image or photograph - such that the user wants to know more about the work.

2. Hello Monday

The website of the creative agency Hello Monday has undergone significant changes, the authors of the article note. The company's developers have done a great job. They managed to make the interface user friendly.

Old Hello Monday agency website

Now the site presents examples of orders already completed by the agency - each project has its own page on which its history is described, which gives the user a deeper understanding of what Hello Monday does.

Updated Hello Monday website

“We tried to move away from the cookie-cutter idea of ​​what a creative agency website should look like,” says Katie Hertel, project manager for the Hello Monday web page redesign. Contributors find the site very attractive and responsive, helped by the organization of projects on the home page, which is automatically updated with new agency work as you scroll down.

3.Multeor

Multeor is a massively multiplayer online game written in JavaScript using the HTML5 canvas element. It was designed by Arjen de Vries and Philidor Weise and designed by Arthur van Hoog. The main task of the user in the game is to control the fall of meteorites, receiving points for the destruction they leave behind.

The game uses a Node.js server to manage communication between desktop and mobile devices With using the Web Sockets.

Weise emphasizes that the development of Multeor did not use existing game libraries:

We wrote everything ourselves - it was very exciting, and we learned a lot of new things. The fact that we did not depend on specific assemblies and prefabs gave us a certain freedom of action: we did not have to deal with rendering existing graphics, handling collisions, and separately describing the system responsible for explosions.

4. Crime Timeline

Crime Timelime is an aggregator that collects UK crime data using public APIs. It allows users to find out how things are going in their region.

“We organized the site in such a way that it showed a map of the region and the location of the crimes - for the month selected by the user in the panel below,” says project developer Alex Miller.

The resource uses the API Google Maps, jQuery and jQRangeSlider were used to create a month panel. When a user interacts with the map, such as clicking on a specific location on the map, the site updates the image using JavaScript. "Bubbles" showing the number of crimes were created with using CSS and animated with using jQuery.

Here is Today used JavaScript to create animations. The creator of the resource, designer Luke Twyman, explains his idea this way: “I wanted to create something that would give everyone a sense of time scale. Here is Today helps us understand how vast the history of the universe is."

Twyman notes that from the very beginning he decided to abandon the standard measurement units - pixels, and described his own based on screen sizes. This was done to ensure that the site looks the same on all devices.

This is the second JavaScript project created by the designer, and in it he used elements that he did not use in the previous one. However, Twyman finds many similarities in the language with other high-level programming languages; moreover, according to him, JavaScript has quite detailed documentation, and there are a large number of examples on the Internet (including on thematic forms).

6. Tweetmap

Tweetmap depicts countries on a map in proportion to the number of tweets sent from them. Service developer Rob Hawkes lists several technologies used in its creation: TopoJSON, D3.js, Node.js, PhantomJS, and special algorithms for constructing adjacent cartograms in real time.

We chose Node.js because we already had experience using it and because it is a simple, fast and flexible platform. To animate the map (in TopoJSON format) we use D3, a fantastic data visualization library. In particular, we make extensive use of the geo module, which allows complex geographic calculations and transformations.

To avoid problems with presenting maps in the client’s browser, the system generates maps on the server using D3, launches and renders them using the PhantomJS engine, and only then transfers them to the user - this avoids creating “holes” when displaying maps.

7. The Trip

The Trip is an interactive movie created using JavaScript and HTML5 (no Flash). Otto Nascarella, the creator of the project, believes that the task of developing such a service turned out to be very difficult:

Most of the difficulties we encountered were due to the fact that HTML5 at the time of writing the site did not have the means for cross-browser development. We then decided that we would recommend that customers use Chrome.

The site's JavaScript code uses jQuery for almost all tasks. The developers also used TextBlur and TextDrop to blur and animate text.

8. Si Digital

This page, written in JavaScript, is the new portfolio and blog of design and marketing agency Si Digital. The lead developer of the project, Alex Kruk, explains the animation on the main page: “The liquid moving through the pipes guides users through our portfolio - it activates the animation of images at each stage of the client’s site exploration.”

To achieve this effect, Crook used the jQuery.animate() method. In addition, he adds, it was necessary to choose the right speed for filling the pipes with liquid - after all, everyone reads at different speeds.

An interactive chart on the page describing completed projects and the agency team, implemented using jQuery. The timeline, according to Crook, is generated dynamically - based on information from the database, using Ajax technology.

9. Jean Halfstein's website

Jean Halfstein is a web designer. In his portfolio, the authors of the article were most attracted to home page- and animation on it. “I had a really good time messing around with the different effects. I really love using new technologies, so I decided to make the main page of my site a kind of sandbox where I have fun with Three.js and the HTML5 canvas element,” Halfstein says.

The designer's idea was to create a portfolio following modern trends— it had to be minimalistic, and at the same time bring something fresh to website design. So he decided to use animation controls using mouse movements and dragging rather than navigation keystrokes.

10. Nick Jones Portfolio

Jones says when he developed the site, he had more experience with Flash than JavaScript, but he wanted to try something new to see what he could do. “I immediately realized that JavaScript syntax almost the same as ActionScript syntax - so very quickly I was completely comfortable,” Jones describes the process of writing code.

Jones recalls that Flash did not give him access to working with mouse movements - it was a new experience that he really enjoyed. The developer wanted to achieve a responsiveness of the site that he could not achieve using class transitions in CSS. Jones is pleased with the result achieved:

If you're thinking about switching from ActionScript to JavaScript, don't hesitate. When making my site, I wanted to see if JavaScript could do what Flash could do. And I'm very impressed.

11. MapsTD

MapsTD is an online game, the essence of which is to defend a fortress. The fortress is the user's own home, which he must defend from the villains who tirelessly roam the streets of the area.

Project creator Duncan Barclay explains how it works: “We used the Google Maps API, MooTools and JavaScript. The hardest part is finding the route that the user's enemies will follow. Once the player has chosen a starting point, the service searches for longitude and latitude, and calculates possible paths using Google."

As the game progresses, more and more opponents appear on the screen. Barclay says that developers had to “fight” with browser timing - the fact is that most of them reduce the frequency of checking for updates on the page over time, and it was necessary to make sure that this did not happen.

Another problem was that as you progressed through the game, the number of enemies increased and performance decreased. As a result, the developers decided to increase the level of the villains’ skills, and not their number.

12. Glimpse Catalogs

The Glimpse resource was developed jointly Windows command IE and the TheFind project, and combines the TheFind search system and the application of the same developers for online shopping on Facebook. As part of Glimpse, programmers released their own framework based on Turn.js.

The team's goal from the very beginning was to make Glimpse a web application, rather than a regular website. The developers used the model-view-behavior paradigm, which separates the data model, user interface, and client interaction into three separate components. The service uses Thrift or JSON client-side model rendering templates, depending on the client’s computing power.

The Turn.js library was also used in the development of catalogs. Using CSS and JavaScript models, presented on the site, are given volume by applying shadows to the image.

13. Red Bull Music Academy Radio

RBMA Radio uses the Modernizr tool, which allows cross-browser development with HTML5 and CSS. Modernizr is constantly updated, so site creators can improve the code as new features are introduced.

In addition, when implementing the service, the Backbone.js library was used - it is used to load tiles to create the effect of an endless page.

14. Nouvelle Vague

Nouvelle Vague is a website from the French design agency Ultranoir. The service allows you to “track” tweets using a given hashtag. It is implemented using JavaScript, WebGL and HTML5. HTML5, however, is only responsible for the teaser when opening a resource.

One of the agency’s developers said that it took four months to create the site, and three people worked on it. “We were really interested in trying out WebGL,” he explains.

The main goal of the project was to recreate the atmosphere from the video using 3D images. The team has immersed itself in the new technologies of HTML5, CSS3 and JavaScript, and believes that these languages ​​can become standards for working with 3D in the future - due to high-quality rendering, rich interaction and responsiveness.

15. The Convergence

The Convergence is a browser game with retro graphics reminiscent of Super Mario Bros. It demonstrates the amazing power of JavaScript and HTML5 and proves that HTML5 can do its job just as well as Flash.

The developers promise to add audio and new levels to the game in the future, as well as support for the Mozilla Gamepad API.

16. Kindle Cloud Reader

This web app makes "buy once, read on all devices" a reality. It uses HTML5 technologies, the JavaScript API, the jQuery and jQuery UI libraries, and several jQuery plugins, including jScrollPane for page scrolling and jQuery Templates. In addition, the development team used WebSQL to support offline mode.

17. Les Enfants Terrible

The site launched by the WeFail studio, the authors of the note believe, looks scary, but still very cool. The resource is made in a rather sharp style. JavaScript is used to animate the interaction between the user and the system. To scroll only for individual elements interface, the team used the jQuery ScrollTo plugin. To make the video appear not in pop-up windows, but directly on the site, the Shadowbox.js library was used.

In addition, the Les Enfants code uses the jQuery Cycle plugin - it is responsible for displaying pictures and examples of the agency’s work.

“We launched Les Enfants to understand the performance capabilities of JavaScript. It turned out that in combination with CSS Transform you can achieve excellent results,” says developer Martin Hugh.

Not so long ago, Hugh notes, such things could only be created with Flash help, but now it has a viable alternative - JavaScript.

18. Pinterest

Pinterest is a prime example of using JavaScript to create the effect of an infinite page. To create the site, we needed jQuery tools, jQuery UI and the PageLess plugin.

According to the authors of the note, PageLess is vital for Pinterest because endless scrolling and loading of new pins is much more effective at keeping the user's attention than social functions such as commenting on posts.

19. Love Bomb Builder

Love Bobm Builder helps users to express their love or gratitude to someone. This is a neat and simple site that allows you to create and send a bomb message.

The resource uses the Modernizr tool to timely update JavaScript and HTML5 code.

20. Michelberger Booze

When a user lands on a site, the first thing he sees is the so-called “preloader” - it may seem that it is made using Flash, but this is not the case. HTML5 and JavaScript are responsible for filling the glass with beer as it loads.

The resource uses a partial scrolling function - only for individual interface elements, and allows the user to interact interactively with images.

By clicking on the animal masks, the client is sent to other scenes - all animation effects in which are performed using jQuery.animate().

21. Trello

Trello is a collaborative or individual planning app where users can create lists of completed and unfinished tasks and share progress in real time. The site is developed using Node.js, MongoDB and Backbone.js.

Trello co-creator Daniel le Cherminan explains that using only one language when writing a website helps new team members get into the development process faster.

Communication between users is implemented using Web Sockets - Le Cherminan notes that this is sufficient new technology, so there were some difficulties when setting it up.

22. BrowserQuest

This retro-style game, created by Little Workshop, aims to demonstrate the power of HTML5, JavaScript and, in particular, Web Sockets. It can support interactions between thousands of users simultaneously.

“Creating a multiplayer game is a great way to demonstrate how such technologies can work together. BrowserQuest relies on Node.js servers, each of which can run multiple instances of the game world,” says studio developer Guillaume Lecolnet.

23. JS1k

JS1k is an annual competition whose task is to create a page in JavaScript on a given topic (most often animated images). Its weight should not exceed 1 KB.

This year's theme is “Here be dragons.”

The winning work of the competition in 2012. Author - Philip Buchanan, theme - "Love"

The 2012 winner's work initially weighed 8 KB - but within a day, Philip was able to reduce its size to the required 1 KB by optimizing the tree generation algorithm:

My tactic was to “honestly deceive” the compiler. For example, using the construction “a ? b: c" instead of "if (a) b else c" saves 8 bytes.

24. Timeline

The service helps users create timelines and is very easy to use. You can include tweets, videos, photos, and audio in your interactive timeline. You can describe your timeline using JSON or Google Docs- whatever is more convenient for the client.

25. Draw a Stickman

The main idea of ​​the service is to provide the user with the opportunity to have a little fun by taking part in an interactive story - helping a drawn little man overcome various obstacles. Sketches on the site are made using the mouse.

To create the game we used jQuery and a library for working with vector graphics Raphal.js. Implementing the project with Raphal helped developers avoid performance issues on most devices and in all browsers.

There are millions of web pages on the Internet, hosted on sites that serve different purposes. Some of them are attractive and others are not.

The ones that look good, are easy to use, and are interactive enough to keep you engaged for a long time are the ones that use JavaScript. What is it for? Let's find out.

It is a multi-paradigm language, which means it supports object-oriented, functional, and imperative programming. Although its name suggests Java, its syntax is derived from the C language.

Most web pages are built in HTML code format. It is a very simple language that allows you to add various elements to a web page that makes it attractive and improves its readability. HTML code allows you to use inline images, colors, and basic animations for web pages, thereby enhancing their appearance. Using CSS(Cascading Style Sheets), provides greater flexibility and reduces the overall amount of code and complexity of web pages. This way, it becomes easier to present the page content in various devices, such as Cell Phones, tablets and desktop computers. JavaScript is primarily used to add interactive elements to web pages, making them more user-friendly and attractive. Let's see what it can do and how it is used.

What is JavaScript?

It is a programming language typically executed on the client side. It is used for user interaction. It is also used in game development, board and mobile applications, in building pdf documents and desktop widgets. Web browsers have built-in support for this language.

Example 1

The first example is quite simple and is usually used in menu items. If you move your mouse over a specific link or menu button, it changes color. This color change based on user actions can be used for various visual effects and also improve the appearance of a web page. In the example below, hover over the button of your choice and see it change color.

Red Green Blue function color(el, color) ( el.style.color = "#FFFFFF"; el.style.backgroundColor = color; ) function uncolor(el) ( el.style.color = "#000000"; el. style.backgroundColor = "#E6E6E6"; )

Example 2

This is a perfect example of an event. I've seen something similar on several web pages. When you press the button, a message appears on the display. It may tell you what to do next or something useful. In the example below, when the button is clicked, a simple message is displayed.

Button

Although JavaScript is widely used, the user should not be completely dependent on it. It has certain security issues since anyone can duplicate the code. Different browsers interpret it differently according to their rendering engines, which may result in inconsistencies on the display. However, despite concerns like these, JavaScript is very popular and widely used throughout the internet.