Support for HTML5's checkValidity Method in Browsers

Nitya Raut
Updated on 25-Jun-2020 07:24:36

166 Views

Yes, the checkValidity() works in Google Chrome and Opera as well. This works as well −Example                    .valid {             color: #0B7866;          }          .invalid {             color: #0B6877;          }                            function check(input) {             var out = document.getElementById('result');             if (input.validity) {                if (input.validity.valid === true) {                   out.innerHTML = "" + input.id +                   " valid";                   } else {                   out.innerHTML = "" + input.id +                  " not valid";                }             }             console.log(input.checkValidity());          };                      Minimum:                                

HTML5 and CSS3 Framework Like Blueprint and 960gs

Arjun Thakur
Updated on 25-Jun-2020 07:23:57

126 Views

You can use the BluePrint/960gs framework or any of the following −52frameworkSusy        52framework (Refer)The framework that provides −CSS3 gradients, multiple shadows, and other amazing properties.CSS3 selectors with support for IE.New and improved HTML5 video support with vimeo like skinA completely new Form Framework with HTML5 Validation (via javascript)Susy (Refer)A lightweight grid-layout framework for Sass. This is designed to clarify responsive grid layouts. Use Susy with floats, flexbox, tables, etc.

CSS Order Property

Lakshmi Srinivas
Updated on 25-Jun-2020 07:23:28

102 Views

Use the order property to set the order of the flex itemsYou can try to run the following code to implement the CSS order property −ExampleLive Demo                    .mycontainer {             display: flex;             background-color: orange;             align-content: space-between;             height: 150px;             width: 600px;             flex-wrap: wrap;          }          .mycontainer > div {             background-color: white;             text-align: center;             line-height: 40px;             font-size: 25px;             width: 100px;             margin: 5px;          }                     Quiz                  Q1          Q2          Q3          Q4          Q5          Q6          Q7          Q8          

NavigableMap Clear Method in Java

karthikeya Boyini
Updated on 25-Jun-2020 07:23:12

134 Views

Clear the NavigableMap in Java, using the clear() method.Let us first create a NavigableMap and add some elements to it −NavigableMap n = new TreeMap(); n.put(5, "Tom"); n.put(9, "John"); n.put(14, "Jamie"); n.put(1, "Tim"); n.put(4, "Jackie"); n.put(15, "Kurt"); n.put(19, "Tiger"); n.put(24, "Jacob");Now, use the clear() method −n.clear();The following is an example to implement clear() method and clear the NavigableMap −Example Live Demoimport java.util.*; public class Demo {    public static void main(String[] args) {       NavigableMap n = new TreeMap();       n.put(5, "Tom");       n.put(9, "John");       n.put(14, "Jamie");       n.put(1, "Tim"); ... Read More

Convert Coordinates to a Place Name with HTML5

Anvi Jain
Updated on 25-Jun-2020 07:22:53

305 Views

For this, use Google Maps API to perform reverse geocoding.Geocoding refers to translating a human-readable address into a location on a map.The process of doing the converse, translating a location on the map into a human-readable address, is known as reverse geocoding.ExampleLet us see an example to set latitude and longitude −function initMap() {    var map = new google.maps.Map(document.getElementById('map'), {       zoom: 8,       center: {lat: 20.502, lng: -22.765}    }); }The reverse geocoder will match countries, provinces, cities and neighborhoods, street addresses, and postal codes.

Perform Animation on CSS clip Property

Arjun Thakur
Updated on 25-Jun-2020 07:22:35

163 Views

To implement animation on clip property with CSS, you can try to run the following codeExampleLive Demo                    div {             width: 200px;             height: 300px;             background: yellow;             border: 10px solid red;             animation: myanim 3s infinite;             bottom: 30px;             position: absolute;             clip: rect(0,100px,50px,0);          }          @keyframes myanim {             20% {                bottom: 100px;                clip: rect(0,150px,40px,0);             }          }                     Performing Animation on clip property          

NavigableMap isEmpty Method in Java

Samual Sam
Updated on 25-Jun-2020 07:22:15

127 Views

Check whether a Map is empty or not using the isEmpty() method.Let us first create a NavigableMap and add some elements to it −NavigableMap n = new TreeMap(); n.put(5, "Tom"); n.put(9, "John"); n.put(14, "Jamie"); n.put(1, "Tim"); n.put(4, "Jackie"); n.put(15, "Kurt"); n.put(19, "Tiger"); n.put(24, "Jacob");Now, use the following method to check whether the Map is empty or not. Since we added some elements above, therefore the Map is not empty −n. isEmpty();The following is an example to implement isEmpty() method −Example Live Demoimport java.util.*; public class Demo {    public static void main(String[] args) {       NavigableMap n = new ... Read More

Animate Box Shadow CSS Property

karthikeya Boyini
Updated on 25-Jun-2020 07:21:46

1K+ Views

To implement animation on box-shadow property with CSS, you can try to run the following codeExampleLive Demo                    div {             width: 200px;             height: 300px;             background: yellow;             border: 10px solid red;             animation: myanim 3s infinite;             bottom: 30px;             position: absolute;          }          @keyframes myanim {             20% {                bottom: 100px;                box-shadow: 30px 45px 70px orange;             }          }                     Performing Animation on box-shadow          

Count Elements in a HashSet in Java

karthikeya Boyini
Updated on 25-Jun-2020 07:21:19

4K+ Views

To count the number of elements in a HashSet, use the size() method.Create HashSet −String strArr[] = { "P", "Q", "R" }; Set s = new HashSet(Arrays.asList(strArr));Let us now count the number of elements in the above Set −s.size()The following is an example to count the number of elements in a HashSet −Example Live Demoimport java.util.Arrays; import java.util.HashSet; import java.util.Set; public class Demo {    public static void main(String[] a) {       String strArr[] = { "P", "Q", "R" };       Set s = new HashSet(Arrays.asList(strArr));       System.out.println("Elements: "+s);       System.out.println("Number of Elements: ... Read More

Translating HTML5 Canvas

Nishtha Thakur
Updated on 25-Jun-2020 07:20:55

414 Views

Use the translate() method to translate canvas. HTML5 canvas provides a translate(x, y) method which is used to move the canvas and its origin to a different point in the grid.Here argument x is the amount the canvas is moved to the left or right, and y is the amount it's moved up or downExample                    #test {             width:100px;             height:100px;             margin:0px auto;          }         ... Read More

Advertisements