Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
HTML Articles
Page 96 of 151
HTML5 geolocation 'permission denied' error in Mobile Safari
When developing mobile websites that request the user's current location on button click, HTML5 Geolocation API is commonly used. While this functionality works seamlessly in Mobile Chrome, Mobile Safari often encounters permission denied errors even when users grant location access. This issue occurs because Mobile Safari has stricter security policies and requires additional system-level permissions to be enabled. The geolocation request may fail silently or return a permission denied error despite user consent in the browser prompt. Understanding the Geolocation API The HTML5 Geolocation API allows web applications to access a user's geographical location through the navigator.geolocation ...
Read MoreHTML DOM Input Month Object
The HTML DOM Input Month Object represents an element with type="month". This input type allows users to select a month and year combination, displaying a month picker interface in supported browsers. The Input Month Object provides properties and methods to programmatically create, access, and manipulate month input fields through JavaScript. Syntax Following is the syntax to create an input month object using JavaScript − var monthInput = document.createElement("INPUT"); monthInput.setAttribute("type", "month"); You can also access an existing month input element − var monthInput = document.getElementById("monthId"); Properties Following are ...
Read MoreSet the shape of the area in HTML
The shape attribute in HTML defines the clickable area's geometry within an image map. It works with the element to create interactive regions on images that users can click to navigate to different links. Syntax Following is the syntax for the shape attribute − The shape attribute accepts four possible values: rect, circle, poly, and default. Each shape type requires specific coordinate formats. Shape Values and Coordinates The following table shows the valid shape values and their coordinate requirements − Shape Value Coordinates Format Description ...
Read MoreExecute a script when a user navigates to a page in HTML?
The onpageshow event in HTML allows you to execute a script whenever a user navigates to a page. This event fires every time a page loads, including when users navigate back using the browser's back button or reload the page. HTML onpageshow Event The onpageshow event occurs when a user navigates to a webpage. Unlike the onload event, onpageshow fires even when the page is loaded from the browser cache, making it ideal for initialization scripts that need to run every time the page is displayed. Syntax Following is the syntax for the onpageshow event in ...
Read MoreHTML DOM Input Month defaultValue Property
The HTML DOM Input Month defaultValue Property is used to set or return the default value of an input field with type="month". This property represents the initial value that was specified in the HTML value attribute when the page loaded. Syntax Following is the syntax for returning the default value − object.defaultValue Following is the syntax for setting the default value − object.defaultValue = value Here, value is a string representing a month in YYYY-MM format, for example "2019-03" for March 2019. Parameters This property accepts the following ...
Read MoreHTML DOM Input Month disabled Property
The HTML DOM Input Month disabled property allows you to check or modify whether an input field with type="month" is disabled or enabled. When disabled, the input field cannot receive focus, cannot be edited, and its value is not submitted with the form. Syntax Following is the syntax for returning the disabled status − object.disabled Following is the syntax for setting the disabled status − object.disabled = true | false Property Values The disabled property accepts the following boolean values − true − The input month field ...
Read MoreHTML DOM Input Month min Property
The HTML DOM Input Month min Property is used to set or return the value of the min attribute of an input field with type="month". This property defines the earliest month that users can select in the month input field. Syntax Following is the syntax for returning the min value − object.min Following is the syntax for setting the min value − object.min = "YYYY-MM" Here, YYYY represents the year (4 digits) and MM represents the month (01-12). For example, "2024-03" represents March 2024. Return Value The property ...
Read MoreHTML DOM Input Month readOnly Property
The HTML DOM Input Month readOnly property controls whether a month input field can be edited by the user. When set to true, the field becomes read-only and users cannot change its value, though the field remains focusable and its value is still included in form submissions. Syntax Following is the syntax for returning the readOnly property − object.readOnly Following is the syntax for setting the readOnly property − object.readOnly = true | false Parameters The readOnly property accepts the following boolean values − true − Makes ...
Read MoreHTML DOM Input Month value Property
The HTML DOM Input Month value property returns and modifies the value of a month input field. This property represents the selected month and year in YYYY-MM format, where YYYY is the four-digit year and MM is the two-digit month (01-12). Syntax Following is the syntax for returning the value − object.value Following is the syntax for setting the value − object.value = "YYYY-MM" Return Value The property returns a string representing the month and year in YYYY-MM format. If no month is selected, it returns an empty string ...
Read MoreExecute a script before the document is printed in HTML?
The onbeforeprint attribute in HTML is an event handler that executes a JavaScript function before a document is printed. This attribute triggers when the user attempts to print the page through browser print functionality (Ctrl+P, File → Print, or print button), displaying custom messages or performing actions before the print dialog appears. The onbeforeprint event is commonly used together with the onafterprint attribute to handle print preparation and cleanup tasks. It belongs to the HTML event attributes category and can be applied to the element or used with JavaScript event listeners. Syntax Following is the syntax ...
Read More