Found 10483 Articles for Web Development

Is 'floating-point arithmetic' 100% accurate in JavaScript?

Nikhilesh Aleti
Updated on 19-Sep-2022 08:53:21

552 Views

Floating point A number which is either positive or negative whole number with having a decimal point to it is called floating point. Let’s consider these numbers, 1.52, 0.14 and also -98.345 are considered as floating point numbers. Whereas 77, 56, 90 and 0 are not considered as floating point numbers. In JavaScript this format will store the numbers in 64 bits. The numbers which are in fraction are stored in 0 to 51 bits. Coming to exponent, they are stored in 52 to 62 bits. And the sign bits will be stored in 63rd bit. Floating point arithmetic Floating ... Read More

How to use spread operator to join two or more arrays in JavaScript?

Nikhilesh Aleti
Updated on 16-Sep-2022 14:39:58

8K+ Views

Array is a variable. Which has an ability to store multiple values in it using appropriate syntax. Every value is referred with index numbers which will start from 0. Const ipl = [“Chennai”, “Mumbai”, Hyderabad”]; Spread operator (…) Spread operator can do the copying of one object or array’s properties and values to another object or array. This will be a shallow copy of the original. Const ipl = [“Chennai”, “Mumbai”, Hyderabad”]; Spread operator can do the copying of one object or array’s properties and values to another object or array. This will be a shallow copy of ... Read More

How to find maximum value in an array using spread operator in JavaScript?

Nikhilesh Aleti
Updated on 16-Sep-2022 13:22:49

1K+ Views

In this article, we are going to discuss how to find the maximum value in an array using the spread operator in JavaScript. For this you need to understand what is an array, what is spread operator and Math.max() method. Array An Array is a variable which is used to store different types of elements. Used to store a bunch of elements and access them with a single variable. Declaration of array can be done in below methods. var House = [ ]; // method 1 var House = new Array(); // method 2 Spread operator (…) This ... Read More

HTML DOM Object type Property

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

178 Views

The HTML DOM Object type Property is used to set or return the value of the type attribute of an object. However, the type attribute is used to set the media type like the object.Following is the syntax to set the type property −obj.type = type_of_mediaAbove, type_of_media is the standard media type, for example, image/bmp, image/tiff, image/tff, etc.Following is the syntax to return the type property −obj.typeLet us now see an example to implement the DOM Object type property −Example Live Demo Display the media type function display() {    var x = document.getElementById("obj").type;     ... Read More

Adding YouTube videos on an HTML web page

George John
Updated on 24-Nov-2023 01:36:49

975 Views

Videos can be easily from YouTube to your web page. You need to just embed the videos. At first, get the Video id − Step1: Go to the Video and right click on it. Select “Stats for nerds” − On clicking, you will get the following dialog box displaying the stats − Above you can see the video id is F6m0ghjadlw. Now, we will embed the same video using its id − Example    Learn WordPress    WordPress Installation    Following is the video demonstrating how to install WordPress on localhost ... Read More

HTML Doctypes

Chandu yadav
Updated on 30-Jul-2019 22:30:26

172 Views

Whenever you create an HTML document, the doctype is the first thing placed in the document.It conveys the web browser about the version of the HTML, this page is written on. It is not casesensitive.Let us see an example displaying DOCTYPE on the top −Example Live Demo Document Title comes here    Demo Heading    This is the demo text. OutputNow let us see some of the declarations for doctype −HTML5 DeclarationExampleHTML 4 StrictThis document type includes all HTML elements except those that have been deprecated, and those that appear in frameset documents.HTML 4 ... Read More

HTML DOM Anchor hash Property

Arjun Thakur
Updated on 30-Jul-2019 22:30:26

189 Views

The HTML DOM Anchor hash property is used to set or return the anchor part of the href attribute value. The part of the URL after the # is what we call the anchor part of a link.Following is the syntax to set the hash property −anchorObject.hash = anchor_partAbove, anchor_part is the anchor part of the URL.Following is the syntax to return the hash property −anchorObject.hashLet us now see an example to implement the DOM Anchor hash property −Example Live Demo Company Our Team Get the anchor part... Display Anchor Part    function display() {     ... Read More

HTML DOM Anchor download Property

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

139 Views

The HTML DOM download property is used to set or return the value of the download attribute of a link.Following is the syntax to set the download property −anchorObject.download = fileAbove, file represents the file name you can set for the file to be downloaded. The actual extension will get suffixed.Following is the syntax to return the download property: anchorObject.downloadLet us now see an example to implement the DOM Anchor download property −Example Live Demo ReactJS Display the value    function display() {       var val = document.getElementById("myid").download;    document.getElementById("demo").innerHTML = val;   ... Read More

HTML colspan Attribute

George John
Updated on 30-Jul-2019 22:30:26

418 Views

The colspan attribute of the element is used to set the number of columns a header cell should span.Following is the syntax −Above, num is the count of columns a header cell should span.Let us now see an example to implement the colspan attribute of the element −Example Live Demo table, th, td {    border: 2px solid green; } Product Expenses           Expenses               Product Development       500000               Marketing       500000               Services       100000               Support       100000               Maintenance       100000               Total Budget = INR 1300000     OutputIn the above example, we have set the column count to span the header cell −ExpensesThe count is 2, therefore two columns will span the header cell.

HTML