Author: Krishnaa

How to Replace all Occurrences of a String in Javascript

In this video tutorial, you will learn how to replace all occurrences of a string in javascript.   HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link rel="stylesheet" href="style.css"> <title>Document</title> </head> <body> <div class="container"> <button>Replace</button> <div class="content"></div> </div> <script src="script.js"></script> </body> </html>   CSS: .container, .content { display:

How to Check if an Element is Present in an Array in Javascript

In this video tutorial, you will learn how to check if an element is present in an array in javascript. HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link rel="stylesheet" href="style.css"> <title>Document</title> </head> <body> <div> <input type="text"> <button>Check</button> <h1>Result</h1> </div> <script src="script.js"></script> </body> </html>   CSS: body {

How to Remove Particular Element from Array in Javascript

In this video tutorial, you will learn how to remove particular element from array in javascript. HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link rel="stylesheet" href="style.css"> <title>Document</title> </head> <body> <div> <input type="text"> <button>Remove</button> <ul></ul> </div> <script src="script.js"></script> </body> </html>   CSS: body { text-align: center; } div

How to Check if Variable is Undefined or Null in Javascript

In this video tutorial, you will learn how to check if variable is undefined or null in javascript.   HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link rel="stylesheet" href="style.css"> <title>Document</title> </head> <body> <div> <button>Check</button> <h1>Result</h1> </div> <script src="script.js"></script> </body> </html>   CSS: body { text-align: center; }

How to Check if Variable is Array in Javascript

In this video tutorial, you will learn how to check if variable is array in javascript.   HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link rel="stylesheet" href="style.css"> <title>Document</title> </head> <body> <div> <button>Check</button> <h1>Result</h1> </div> <script src="script.js"></script> </body> </html>   CSS: body { text-align: center; } div {