Use the border-secondary class in Bootstrap 4 to add a gray border to an element.Set the border as − Gray border I have styled our element as shown in the following code snippet − .test { width: 200px; height: 150px; margin: 10px; } You can try to run the following code to implement the border-secondary class −ExampleLive Demo Bootstrap Example .test { width: 200px; height: 150px; margin: 10px; } Rectangle Gray border
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 time and thereafter, the cookies' value will not be accessible.ExampleTry the following. It sets a customer name in an input cookie.Live Demo Enter ... Read More
Using cookies is the most efficient method of remembering and tracking preferences, purchases, commissions, and other information required for better visitor experience or site statistics.The 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 time and thereafter, the cookies' value will not be accessible.Note − Cookie values may not include semicolons, commas, or whitespace. For this reason, you may want to ... Read More
Create cookiesThe 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 time and thereafter, the cookies' value will not be accessible.ExampleTry the following. It sets a customer name in an input cookie.Live Demo ... Read More
Whenever we try to sort elements with null values using the sort method it throws an exception.The sort() method of the Arrays class also accepts a Comparator along with the array. Using comparator, you need to specify the order in which the elements need to be sorted.Using this method push all the null elements to last and sort the elements −Example Live Demoimport java.util.Arrays; import java.util.Comparator; public class ArrayWithNullsInOrder { public static void main(String args[]) { String[] myArray = {"JavaFX", null, "OpenCV", null, "Hadoop", null}; Arrays.sort(myArray, Comparator.nullsLast(String.CASE_INSENSITIVE_ORDER)); System.out.println(Arrays.toString(myArray)); } }Output[Hadoop, JavaFX, OpenCV, null, null, null]Read More
Use align-text-top class to align an element with the top of the parent element's font.Set the align-text-top class as − Top Text You can try to run the following code to implement the align-text class in Bootstrap 4 −ExampleLive Demo Bootstrap Example Example This is demo text Demo Baseline Top Alignment Top Text Bottom Text
You can extend the life of a cookie beyond the current browser session by setting an expiration date and saving the expiry date within the cookie. This can be done by setting the ‘expires’ attribute to a date and time.ExampleYou can try to run the following example to set cookies to expire in 1 hour − Enter name:
To fire a JavaScript function when the user finishes typing, try to run the following code −Example var timer = null; $("#myText").keydown(function(){ clearTimeout(timer); timer = setTimeout(doStuff, 1000) }); function doStuff() { alert("Write more!"); }
In this problem, one undirected graph is given, we have to check the graph is tree or not. We can simply find it by checking the criteria of a tree. A tree will not contain a cycle, so if there is any cycle in the graph, it is not a tree.We can check it using another approach, if the graph is connected and it has V-1 edges, it could be a tree. Here V is the number of vertices in the graph.Input and OutputInput: The adjacency matrix. 0 0 0 0 1 0 0 0 0 1 0 0 0 ... Read More
Extend the life of a cookie beyond the current browser session by setting an expiration date and saving the expiry date within the cookie. This can be done by setting the ‘expires’ attribute to a date and time.ExampleYou can try to run the following example to set the expiry date of a cookie by 1 Month − Enter name:
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP