You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`setCustomValidity()` - Sets the validationMessage property of an input element.
@@ -2771,14 +2783,38 @@ Web API is an application programming interface for the Web.
2771
2783
2772
2784
`rangeOverflow` - Set to true, if an element's value is greater than its max attribute.
2773
2785
2774
-
```jsx
2786
+
```html
2787
+
<input id="id1" type="number" max="100">
2788
+
<button onclick="myFunction()">OK</button>
2789
+
2790
+
<p id="demo"></p>
2791
+
```
2775
2792
2793
+
```jsx
2794
+
functionmyFunction() {
2795
+
let text ="Value OK";
2796
+
if (document.getElementById("id1").validity.rangeOverflow) {
2797
+
text ="Value too large";
2798
+
}
2799
+
}
2776
2800
```
2777
2801
2778
2802
`rangeUnderflow` - Set to true, if an element's value is less than its min attribute.
2779
2803
2780
-
```jsx
2804
+
```html
2805
+
<input id="id1" type="number" max="100">
2806
+
<button onclick="myFunction()">OK</button>
2807
+
2808
+
<p id="demo"></p>
2809
+
```
2781
2810
2811
+
```jsx
2812
+
functionmyFunction() {
2813
+
let text ="Value OK";
2814
+
if (document.getElementById("id1").validity.rangeUnderflow) {
2815
+
text ="Value too small";
2816
+
}
2817
+
}
2782
2818
```
2783
2819
2784
2820
`stepMismatch` - Set to true, if an element's value is invalid per its step attribute.
@@ -2818,65 +2854,177 @@ Web History API provides easy methods to access the windows.history object.
2818
2854
`Historyback()` Method
2819
2855
2820
2856
```javascript
2821
-
2857
+
functionmyFunction() {
2858
+
window.history.back();
2859
+
}
2822
2860
```
2823
2861
2824
2862
`Historygo()` Method
2825
2863
2826
2864
```javascript
2827
-
2865
+
functionmyFunction() {
2866
+
window.history.go(-2);
2867
+
}
2828
2868
```
2829
2869
2830
2870
**History Object Properties** -
2831
2871
2832
2872
`length` - Returns the number of URLs in the history list
2833
2873
2834
2874
```javascript
2835
-
2875
+
history.length
2836
2876
```
2837
2877
2838
2878
**History Object Methods** -
2839
2879
2840
2880
`back()` - Loads the previous URL in the history list
2841
2881
2842
2882
```javascript
2843
-
2883
+
history.back()
2844
2884
```
2845
2885
2846
2886
`forward()` - Loads the next URL in the history list
2847
2887
2848
2888
```javascript
2849
-
2889
+
history.forward()
2850
2890
```
2851
2891
2852
2892
`go()` - Loads a specific URL from the history list
2853
2893
2854
2894
```javascript
2855
-
2895
+
history.go()
2856
2896
```
2857
2897
2858
2898
**Storage API** -
2859
2899
2900
+
Web Storage API is a simple syntax for storing and retrieving data in the browser.
2901
+
2902
+
The localStorage Object -
2903
+
2904
+
The localStorage object provides access to a local storage for a particular Web Site. It allows you to store, read, add, modify, and delete data items for that domain.
0 commit comments