Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Javascript Articles
Page 265 of 534
How can I round down a number in JavaScript?
This tutorial teaches us to round down a number in JavaScript. The meaning of the round-down number is "returning the integer which is equal to or less than the current float number". For example, if we round down the number 9.99, we get 9 as an output, and in the same way, for 8.01 we get 8 as an output. In simple terms, if you represent your current number in the number line, you must return the nearest integer that resides on the left side of the current number. In this tutorial, we will take a look at ...
Read MoreHow to design a modern Website?
Modern websites are responsive and the design works fine on multiple devices such as Desktop, Tablet, and Mobile. Also, websites these days do not follow the old font styles, many of them use Google fonts since it's easy to find a font-face matching your website's content and Google provides a lot of free fonts to choose from. Modern websites display beautifully formatted content on multiple devices such phones, tablets, and desktops. Also, nowadays Retina-ready logos help in keeping your logo amazing, no matter the resolution. Follow the below given steps and learn how to design a modern website: ...
Read MoreHow to add hours and minutes to a date with JavaScript?
In this tutorial, we will learn how to add hours and minutes to a date with JavaScript. We have multiple methods to achieve this which are the following. Add hours using the setHours() Method. Add minutes using the setMinutes() Method. Add hours or minutes with the getTime() Method. Add hours using the setHours Method JavaScript date setHours() method sets the hours for a specified date according to local time. Syntax Following is the syntax to apply the setHours() method to add ...
Read MoreHow to play a multimedia file using JavaScript?
In this tutorial, we will learn how to play a multimedia file using JavaScript. The multimedia file is the audio and video files. The multimedia files can be of different formats. wav and mp3 are two examples of audio file formats, whereas mp4 and mkv are examples of video file formats. In HTML, multimedia files can be shown easily using different tags. We use the video tag for showing a video, and for audio, we use the audio tag. These two tags are quite similar, and many attributes are the same in both tags. The "src" attribute defines ...
Read MoreHow can I show image rollover with a mouse event in JavaScript?
This tutorial will teach us to show image rollover with a mouse event in JavaScript. The meaning of the image rollover is to either change the image style or the whole image when the user rollovers the mouse on the image. To build an attractive user interface, developers often add image rollover features to the website and applications. Here, we will see to apply image rollover differently. Change the Style of the Image on Mouse Rollover In this method, to create the image rollover, we will use the onmouseover and onmouseout event of JavaScript. When users take ...
Read MoreHow to show the number of links in a document with JavaScript?
We use the links property of the document object to show the number of links in a document with JavaScript. The document object, part of the DOM, corresponds to the current web page that the browser has loaded. It contains all the information about the condition of the browser as well as the web page. The links is a property of the document object that returns a list of all the hyperlinks present in the HTML document. A hyperlink may look something like this: "https://www.tutorialspoint.com/php" The links property of the document object lists all HTML ...
Read MoreWhat are the best practices to be followed while using JavaScript?
In this tutorial, we will learn the best practices to follow while using JavaScript. JavaScript is used in almost every website to make it more user interactive. Throughout the years, ECMAScript has released different versions of JavaScript. Each version has enhanced functionalities and new features, so it is important to know the best practices to follow while using JavaScript. The following are the best practices to be followed while using JavaScript − Meaningful Variable and Function Names The variables' and functions' names should be meaningful to their uses. In JavaScript, we use the variable to store ...
Read MoreWhat are the rules to be followed for Object Definitions in JavaScript?
In this tutorial, we will discuss the rules to follow for Object Definitions in JavaScript. JavaScript is an object-oriented scripting language. An object contains many properties. The property consists of a key and a value. The property is known as a method when this value is a function. Predefined objects are available in the browser. We can also define our objects. A real-life example of an object is a cup. The color, design, weight, and material are the main properties of a cup. The object name and the property name are case-sensitive. To define a property, we ...
Read MoreHow to convert Decimal to Binary in JavaScript?
This tutorial will teach us to convert the decimal number to a binary number string. The binary number is the string of only 0 and 1. The computer doesn't understand the high-level programming language, so we need to instruct the computer in a low-level language, represented as the binary string. Also, binary string is used in digital electronics. Here, we have three methods to convert the decimal number to a binary string. Using the toString() Method Using the right shift Operation Using the modulo Operator Using ...
Read MoreHow to set the widths of the image border with JavaScript?
In this tutorial, we shall learn to set the widths of the image border with JavaScript. To set the widths of the image border, use the borderImageWidth property in JavaScript. When we need an image as a border of our webpage content, we have to see how to set the width of the image border. Using the Style borderImageWidth Property With the Style borderImageWidth property, we can set or return the widths of the image border of an element. The border image will range beyond the padding when the border image width is greater than the ...
Read More