Please have a look at the following articles i.e. polymorphism and inheritance in C++ which is really important to know before going through the virtual functions. As we know, through inheritance one class (derived class) can inherit the features of…
Like normal input fields, values from the hidden input field can be accessed using the element.val(). Following is an example of how to do that. val() function fetches the html value from the specific object and in this case it…
This can be done by using getElementsByTagName() or querySelectorAll(). Old browsers don’t support the querySelectorAll() so in such a case you have to use the other one and then manually write a for loop to iterate over each node and…
For every click, an event will be triggered and that event contains all the info about the element. So, we obviously have to catch that event to get the element info and it can be easily done with JS. When…
As per my experience, the screen rotation behaviour across different devices is not the same. The events such as resize and orientation may not fire simultaneously and occur at different timeframes. The values such as window.orientation and screen.width may not…
To set the document title in reactJS, we can create a custom hook and use it. The following is the solution. Now, use the above custom hook in whichever component you want. The above custom hook updates the title with…
It is straightforward to replace the DOM element in javascript with some other element. replaceWith() method is used to replace the HTML element in Javascript. Follow is the working example: This is a span element Code: Explanation In the above…
Unlike java where the object for the class can be declared only in the heap, C++ allows us to allocate memory for an object in the stack Object in stack If an object is required for a shorter amount of…
In this article, I will give an introduction to the object oriented programming and we will see what is the major difference between module based programming approach and object oriented programming. Unlike C programming language which follows a procedural/modular based…
What is endianness? Endianness specifies the order in which the bytes of data are stored/processed by a computer. For example, let’s consider a variable that is of 4bytes, and in the memory, it looks like this as shown below. When…