Sreemaha has Published 87 Answers

How do we reset all the input fields in HTML forms?

Sreemaha

Sreemaha

Updated on 17-Jun-2020 13:56:01

Using HTML forms, you can easily take user input. The <form> tag is used to get user input, by adding the form elements. Different types of form elements include text input, radio button input, submit button, etc.The <input> tag helps you to take user input using the type attribute. To ... Read More

How to split JavaScript Number into individual digits?

Sreemaha

Sreemaha

Updated on 17-Jun-2020 06:40:51

To spilt a number into digits and print their sum, try to run the following code −ExampleLive Demo<!DOCTYPE html> <html>    <body>       <script>          var a = 28573;          var sum = 0;          while(a > 0) { ... Read More

How to create an ordered list with list items numbered with uppercase roman numbers in HTML?

Sreemaha

Sreemaha

Updated on 17-Jun-2020 06:15:20

To create ordered list in HTML, use the <ol> tag. Ordered list starts with the <ol> tag. The list item starts with the <li> tag and will be marked as numbers, lowercase letters uppercase letters, roman letters, etc. The default numbers for list items.For creating an ordered list with uppercase ... Read More

How to print object array in JavaScript?

Sreemaha

Sreemaha

Updated on 16-Jun-2020 13:27:10

To print object array in JavaScript, use JSON.stringify() method.ExampleYou can try to run the following code to display object array −Live Demo<!DOCTYPE html> <html>    <body>       <pre id="test"></pre>       <script>          var data = [{             date: ... Read More

How to create HTML link that doesnt follow the link?

Sreemaha

Sreemaha

Updated on 16-Jun-2020 13:15:46

Use “nofollow” to create HTML link that doesn’t follow the link. In HTML, while adding an external link, you can set the attribute “rel” as “nofollow” or “dofollow” −The “nofollow” value tells the search engine − “Don't follow links on this page" or "Don't follow this specific link."<a href="example.com" rel="nofollow">Another ... Read More

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

Sreemaha

Sreemaha

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

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 ... Read More

What are all the ways keyword ‘this’ can be used in Java?

Sreemaha

Sreemaha

Updated on 16-Jun-2020 07:50:59

You can use this keyword to –Differentiate the instance variables from local variables if they have same names, within a constructor or a method.class Student {    int age;    Student(int age) {       this.age = age;    } }Call one type of constructor (parametrized constructor or default) ... Read More

What is lexical this in JavaScript?

Sreemaha

Sreemaha

Updated on 16-Jun-2020 06:24:31

Fat arrow function solves the issue of lexical binding “this”. It gets the context of “this “and you can fulfill the same purpose since fast arrow does not have its own this. Fat arrow function as the name suggests helps in decreasing line of code. The syntax => shows fat ... Read More

How to use an animated image in HTML page?

Sreemaha

Sreemaha

Updated on 15-Jun-2020 11:02:48

Animated images in HTML are an image on a web page that moves. It is in GIF format i.e. Graphics Interchange Format file.To add an animated image in HTML is quite easy. You need to use the <image> tag with the src attribute. The src attribute adds the URL of the image.Also, ... Read More

Create JS Radial gradient with matrix in HTML

Sreemaha

Sreemaha

Updated on 02-Jun-2020 07:40:33

JSRadial gradient with matrix is created in the following way. You can try to run the following way to create JS Radial gradient with matrix −var canvas1 = document.getElementById("canvas"); //canvas1 variable to identify given canvas var ctx1 = canvas.getContext("2d"); //This is used to tell context is 2D   var ... Read More

Advertisements