AmitDiwan has Published 10744 Articles

How to switch between dark and light mode with CSS and JavaScript?

AmitDiwan

AmitDiwan

Updated on 08-May-2020 13:26:19

438 Views

To switch between dark and light mode with JavaScript, the code is as follows −Example Live Demo    body {       padding: 25px;       background-color: white;       color: black;       font-size: 25px;       font-family: "Segoe UI", Tahoma, ... Read More

How to toggle between hiding and showing an element with JavaScript?

AmitDiwan

AmitDiwan

Updated on 08-May-2020 13:23:28

927 Views

To toggle between hiding and showing an element with JavaScript, the code is as follows −Example Live Demo    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    button {       padding: 10px;       border: none;   ... Read More

How to create a fixed/sticky header on scroll with CSS and JavaScript?

AmitDiwan

AmitDiwan

Updated on 08-May-2020 12:57:49

1K+ Views

To create fixed/sticky header on scroll with CSS and JavaScript, the code is as follows −Example Live Demo    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;       margin: 0px;       padding: 0px;       height: 150vh; /*To ... Read More

How to create a gradient background color on scroll with CSS?

AmitDiwan

AmitDiwan

Updated on 08-May-2020 12:54:39

460 Views

To create a gradient background color on scroll, the code is as follows −Example Live Demo    body {       height: 250vh;       color: white;       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;       background: linear-gradient(         ... Read More

How to draw on scroll using JavaScript and SVG?

AmitDiwan

AmitDiwan

Updated on 08-May-2020 12:48:13

532 Views

To draw on scroll using JavaScript and SVG, the code is as follows −Example Live Demo    body {       height: 2000px;       background: #f1f1f1;    }    svg {       position: fixed;       top: 15%;       ... Read More

How to make a fullscreen window with JavaScript?

AmitDiwan

AmitDiwan

Updated on 08-May-2020 12:46:12

544 Views

To create a fullscreen window with JavaScript, the code is as follows −Example Live Demo    body{       font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;    }    button{       display: block;       padding:10px;       margin:10px;       background-color: rgb(81, 0, 128);       border:none;       color:white;    } Fullscreen Window with JavaScript Example

symbol.description property in JavaScript

AmitDiwan

AmitDiwan

Updated on 08-May-2020 12:29:18

84 Views

The symbol.description property returns the optional description of the symbol objects and is a read only property.Following is the code for symbol.description property −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    div {   ... Read More

array.flatMap() in JavaScript

AmitDiwan

AmitDiwan

Updated on 08-May-2020 12:25:55

157 Views

The JavaScript array.flatMap() function flattens the given nested array into a new flat array.Following is the code for the array.flatMap() method −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample {       ... Read More

array.entries() Method in JavaScript.

AmitDiwan

AmitDiwan

Updated on 08-May-2020 12:22:02

175 Views

The JavaScript array.entries() method returns key/value pairs as an array iterator object.Following is the code for the array.entries() method −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample {       font-size: 20px; ... Read More

JavaScript symbol.toString()

AmitDiwan

AmitDiwan

Updated on 08-May-2020 12:03:55

72 Views

The JavaScript symbol.toString() returns the string representation of the specified symbol object.Following is the code for Symbol.toString() method −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    div {       font-size: 20px;   ... Read More

Advertisements