Day of the Week in C++

Arnab Chakraborty
Updated on 19-Feb-2021 07:24:45

7K+ Views

Suppose we have a date (day, month and year). From this date, we have to find the day of the week of that given date. To solve this we will use Zeller’s Algorithm. The formula to find weekday using Zeller’s Algorithm is here𝑤=$$\lgroup d+\lfloor \frac{13(m+1)}{5} \rfloor+y+\lfloor\frac{y}{4} \rfloor+\lfloor\frac{c}{4} \rfloor+5c \rgroup mod 7$$The formula is containing some variables; They are −d − The day of the date.m − It is the month code. For March to December, it is 3 to 12, for January it is 13, and for February it is 14. When we consider January or February, then the given ... Read More

HTML DOM Footer Object

AmitDiwan
Updated on 19-Feb-2021 07:23:32

664 Views

The HTML DOM Footer object is associated with the HTML element. The element is a type of semantic tag and introduced in the HTML5. Using the Footer object we can create and get the element using the createElement() and getElementById() method respectively.SyntaxFollowing is the syntax for −Creating a footer object −var p = document.createElement("FOOTER");ExampleLet us look at an example of the Footer object −Live Demo    function createFoot() {       var f = document.createElement("FOOTER");       document.body.appendChild(f);       var p = document.createElement("P");       var txt = document.createTextNode("Copyright ... Read More

HTML DOM Form Autocomplete Property

AmitDiwan
Updated on 19-Feb-2021 07:20:57

179 Views

The HTML DOM Form autocomplete property is associated with the autocomplete attribute of the form element. Using the autocomplete property we can set or return autocomplete attribute value of the given form. This property specifies if the input field should autocomplete text being written by the user based on the text that was previously written in the text field.The autocomplete property can be turned off for specific input fields if autocomplete is set on for the form and it is true for vice-versa also.SyntaxFollowing is the syntax for −Set the autocomplete property −formObject.autocomplete = on|offHere, “on” is by default and ... Read More

HTML DOM Form Enctype Property

AmitDiwan
Updated on 19-Feb-2021 07:19:17

203 Views

The HTML DOM Form enctype property is associated with the enctype attribute of the form element. This property sets or returns the enctype attribute value of the form. The enctype attribute is only used if the method attribute value is “POST”. The enctype property is used for specifying the data in the form to be submitted should be encoded.SyntaxFollowing is the syntax for −Setting the enctype property −formObject.enctype = encodingHere, encoding can be “application/x-www-form-urlencoded”, which means all characters are encoded before it is sent and this is the default encoding.Another one is “multipart/form-data”, which specifies that no character should be ... Read More

HTML DOM Input Reset Value Property

AmitDiwan
Updated on 19-Feb-2021 06:21:38

395 Views

The HTML DOM Input reset value property is used to return the value of reset button value attribute or to set it. The value property for reset button changes the text that is displayed upon button as by default the text is “Reset”.SyntaxFollowing is the syntax for −Setting the value property −resetObject.value = text;Here, text is used for specifying the text displayed on the reset button.ExampleLet us look at an example for the input reset value property −Live Demo Input reset Value property UserName: Location: Get the above element value by ... Read More

HTML DOM Input Search Autocomplete Property

AmitDiwan
Updated on 19-Feb-2021 06:19:07

267 Views

The HTML DOM Input Search autocomplete property is associated with the autocomplete attribute of the element with type=”search”. The autocomplete attribute takes “on” or “off” value. The on value specifies that the web browser must automatically complete user text based on previous input while false states otherwise.SyntaxFollowing is the syntax for −Setting the autocomplete Property −searchObject.autocomplete = "on|off"Here, on means the web browser will complete the user input automatically based on previous input while false states that it will not complete any of the user input based on previous inputs. It has the value set to on by default.ExampleLet ... Read More

HTML DOM Input Search DefaultValue Property

AmitDiwan
Updated on 19-Feb-2021 06:16:45

156 Views

The HTML DOM Input Search defaultValue property is used for setting or getting the defaultValue of a search field. The defaultValue of an element is the value assigned to the value attribute. The difference between value and defaultValue property is that the defaultValue property retains the original default value while the value property value change based on the user input in the search field.SyntaxFollowing is the syntax to set the defaultValue property −searchObject.defaultValue = valueHere, “value” is the search field default value.ExampleLet us look at an example for the Search defaultValue property −Live Demo Input Search defaultValue Property ... Read More

HTML DOM Input Search Disabled Property

AmitDiwan
Updated on 19-Feb-2021 06:14:56

352 Views

The HTML DOM Input Search disabled property is used for setting or returning whether the search field should be disabled or not. It uses boolean values with true representing the element should be disabled and false otherwise. The disabled property is set to false by default. However, the disabled element is greyed out by default and is unclickable.SyntaxFollowing is the syntax for −Setting the disabled property −searchObject.autofocus = true|falseHere, true=search field is disabled and false=the search field is not disabled. It is false by default.ExampleLet us look at an example for the Input Search disabled property −Live Demo ... Read More

HTML DOM Input Search Pattern Property

AmitDiwan
Updated on 19-Feb-2021 06:12:33

148 Views

The HTML DOM Input Search pattern property is used for setting or returning the pattern attribute of an input search field. It checks the search field time against a regular expression that is specified by the pattern property.SyntaxFollowing is the syntax for −Setting the pattern property −searchObject.pattern = regexpHere, regexp is a regular expression against which the search field is checked.ExampleLet us look at an example for the Input Search pattern property −Live Demo Input Search pattern property The time inside search field can either be of three numeric characters or 6 alphabet characters from a to g ... Read More

HTML DOM Input Search Placeholder Property

AmitDiwan
Updated on 19-Feb-2021 06:10:42

277 Views

The HTML DOM Input Search placeholder property is used for setting or returning the placeholder attribute value of an input search field. The placeholder property is used for giving the web page users a hint about the input element by showing a text inside the input field before the user inputs anything. The placeholder text is greyed by default and isn’t submitted to the form unlike the value property.SyntaxFollowing is the syntax for −Setting the placeholder property −searchObject.placeholder = textHere, text represents the placeholder text specifying the hint for the user about the search field.ExampleLet us look at an example ... Read More

Advertisements