Found 9053 Articles for Front End Technology

How can I trigger a JavaScript click event?

Prabhas
Updated on 03-Oct-2019 07:46:57

1K+ Views

To trigger a JavaScript click event, let us see the example of mouse hover.ExampleLive Demo           Hover over the button.                                      function display() {             document.getElementById("test").click();          }          

Can we make print button without JavaScript?

Shubham Vora
Updated on 23-Aug-2022 09:37:59

571 Views

In this tutorial, we will learn to make the print button without using JavaScript. Most of you have seen the print button on any website or application, and when users click on the print button, it prints the whole webpage or any particular file. However, the HTML doesn’t contain the print method. We can use the print() method of the window object. The window object is the global object, which can be accessed anywhere inside the code. So, either user can invoke the window.print() method from the JavaScript or HTML code.Syntax Users can follow the syntax below to invoke JavaScript's ... Read More

How to find out which JavaScript events fired?

Abhishek
Updated on 31-Oct-2022 07:48:30

11K+ Views

In this tutorial, we will learn how we can find out which JavaScript event is fired or triggered. We can add events to HTML elements to perform some actions on the webpage like changing text, form submission, etc. There are two ways of finding which JavaScript event is fired − Using Developer Tools Using Inspect Element Let us discuss both of them one by one with coding examples. Using Developer Tools We can find out which JavaScript event is fired by using developer tools in the browser. To open Developer tools, you need to press ctrl + shift ... Read More

How to make an image responsive in HTML?

Lokesh Badavath
Updated on 18-Nov-2022 10:43:28

5K+ Views

Responsive images will automatically adjust to the size of the screen and to the tab size. To make image responsive first we must add image to the web page using tag, then by using style sheet we can change the parameters of the image to make an image responsive in HTML. Syntax Following is the syntax to make an image responsive in HTML. Example Following is the example program to make an image responsive in HTML. In here, we have used inline style sheet. DOCTYPE html> Responsive Image ... Read More

What is the difference between local storage vs cookies?

varun
Updated on 30-Jul-2019 22:30:21

1K+ Views

On client and server, the following storages are available: local storage, session storage, and cookies.The Local Storage is designed for storage that spans multiple windows and lasts beyond the current session. In particular, Web applications may wish to store megabytes of user data, such as entire user-authored documents or a user's mailbox, on the client side for performance reasons. Cookies do not handle this case well because they are transmitted with every request.Local Storage is available for every page and remains even when the web browser is closed, but you cannot read it on the server.The stored data has no ... Read More

How to secure my JavaScript using "Strict mode"?

Prabhdeep Singh
Updated on 07-Nov-2022 08:07:42

160 Views

In this tutorial, we are going to learn how to secure my JavaScript using “Strict mode”. There are some errors in the code which are just ignored by the JavaScript engine and if any line fails it perform nothing, to indicate that there is an error we can use the strict mode which will make the JavaScript engine throw an error. The ‘use strict’ is a literal expression which is the directive we can add to the code, not in any block. We can add this ‘use strict’ directive in the whole script, a function, or in a class. Syntax ... Read More

How to create clickable areas in an image in HTML?

Anjana
Updated on 22-Dec-2021 11:09:45

7K+ Views

To create clickable areas in an image, create an image map, with clickable areas. For example, on clicking a box, the different website opens and on clicking a triangle in the same image, a different website opens.The tag defines an area inside an image-and nested inside a tag. The following are the attributes:Sr.NoAttribute & Description1altThe alternate text for the area2coordsThe coordinates for the area3downloadThe target will download when the hyperlink is clicked4shapeThe shape of the area5targetWhere the URL will openExampleYou can try to run the following code to create clickable areas in an image in HTML   ... Read More

How much data can I store in JavaScript cookies?

varma
Updated on 16-Jun-2020 12:14:45

385 Views

The following are the details of the date you can store in JavaScript cookies −Web BrowserMaximum cookiesMaximum size per cookieGoogle Chrome1804096 bytesFirefox1504097 bytesOpera1804096 bytesAndroid504096 bytes

What is the use of JavaScript cookies?

Giri Raju
Updated on 09-Jan-2020 08:33:06

160 Views

Using cookies is the most efficient method of remembering and tracking preferences, purchases, commissions, and other information required for better visitor experience or site statistics.Your server sends some data to the visitor's browser in the form of a cookie. The browser may accept the cookie. If it does, it is stored as a plain text record on the visitor's hard drive. Now, when the visitor arrives at another page on your site, the browser sends the same cookie to the server for retrieval. Once retrieved, your server knows/remembers what was stored earlier.Cookies are a plain text data record of 5 ... Read More

How to set a cookie and get a cookie with JavaScript?

Sreemaha
Updated on 16-Jun-2020 11:56:32

3K+ Views

Set CookieThe simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this:document.cookie = "key1=value1;key2=value2;expires=date";Here the “expires” attribute is optional. If you provide this attribute with a valid date or time, then the cookie will expire on a given date or time and thereafter, the cookies' value will not be accessible.ExampleTry the following. It sets a customer name in an input cookie.Live Demo                                                  Enter ... Read More

Advertisements