The HTML DOM MenuItem Object in HTML represents the element.NOTE − element only supported in Mozilla Firefox Browser.SyntaxFollowing is the syntax −Creating a elementvar menuItemObject = document.createElement(“MENUITEM”)PropertiesHere, menuItemobject can have the following properties −PropertyDescriptioncheckedIt sets/returns (true/false) if the menu item should be checkedcommandIt sets/returns the value of the command attributedefaultIt sets/returns whether the menuItem should be the defaultdisabledIt sets/returns whether the menu item should be disablediconIt sets/returns an image that represents the menuItemlabelIt sets/returns the value of the label attribute of the menuItemradiogroupIt sets/returns the value of the radiogroup attribute of the menuItemtypeIt sets/returns the value of ... Read More
The HTML DOM Menu Object in HTML represents the element.NOTE − element only supported in Mozilla Firefox Browser.SyntaxFollowing is the syntax −Creating a elementvar menuObject = document.createElement(“MENU”)ExampleLet us see an example for HTML DOM Menu element − Live Demo Menu Object form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } Menu-Object Current URL: ... Read More
The HTML DOM Mark Object in HTML represents the element.SyntaxFollowing is the syntax −Creating a elementvar markObject = document.createElement(“MARK”)ExampleLet us see an example for HTML DOM Mark element − Live Demo HTML DOM Mark form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } HTML-DOM-Mark Full Name: var divDisplay ... Read More
The HTML DOM Map Object in HTML represents the element.SyntaxFollowing is the syntax −Creating a elementvar mapObject = document.createElement(“MAP”)PropertiesHere, “mapObject” can have the following collections & properties −Collection/ PropertyDescriptionareasIt returns a collection of all elementsimagesIt returns a collection of all & elementsnameIt sets/returns the value of the name attribute for elementExampleLet us see an example for Map areas collection − Live Demo Map areas collection form { width:70%; margin: 0 auto; text-align: center; } * { padding: ... Read More
Math.asinh() and Math.acosh() functions are used to find the hyperbolic arc-sine and hyperbolic arc-cosine of a number respectively. These functions are static methods of Math, therefore they are always used as Math.asinh() and Math.acosh(), rather than as methods of a math object created.Math.asinh()This method is used to find the hyperbolic arc-sine of a number. It takes a number as a parameter and returns hyperbolic sine value.ExampleLive Demo document.write(Math.asinh(2)); document.write(""); document.write(Math.asinh(7)); Output1.4436354751788103 2.644120761058629Math.acosh()This method is used to find the hyperbolic arc-cosine of a number. It takes a number ... Read More
Math.imul( )Unlike other multiplying functions, the Math.imul() function returns the result of the C-like 32-bit multiplication of the two parameters. Its application is very high in projects like Emscripten. syntaxvar product = Math.imul(a, b);This method takes two numbers and gives out their multiplication value.Example-1In the following example, two normal integers were given as parameters to the method Math.Imul() and the obtained result is displayed as shown in the output.Live Demo document.write(Math.imul(3, 4)); document.write(""); document.write(Math.imul(-3, 4)); Output12 -12Example-2In the following example, c-like 32-bit values were given as parameters to ... Read More
Let us consider one semicircle is given. Its radius is R. One rectangle of length l and breadth b is inscribed in that semi-circle. Now one circle with radius r is inscribed in the rectangle. We have to find the area of the inner circle.As we know biggest rectangle that can be inscribed within the semi-circle has length l and breadth b, then the equation of l and b will be like following −Now, the biggest circle that can be inscribed within the rectangle has radius r is like below −Example#include #include using namespace std; float innerCircleArea(float R){ ... Read More
Here we will see how to get the arc length from the given angle. One circle is given. The radius of the circle is given. Our task is to get the arc length using the radius and the angle. The angle is in degree.Here r and x is given. We have to find the value of L. The formula is like below −𝐿 = 2𝜋𝑟 ∗ (𝑥/360)Example#include using namespace std; float getArcLength(float r, float x){ return (2 * 3.1415f * r) * (x / 360.0f); } int main() { float rad = 12.0f; float angle = 45.0f; cout
Here we will see one interesting problem. We have one binary tree. We have to traverse the tree in anti-clockwise manner. The traversal will be like below −The traversal sequence is 1, 8, 9, 10, 11, 12, 13, 14, 15, 3, 2, 4, 5, 6, 7AlgorithmantiClockTraverse(root)Begin i := 1, j := height of the tree flag := false while i data = data; this->left = NULL; this->right = NULL; } }; int getHeight(Node* root) { if (root == NULL) return 0; //get height of left and right ... Read More
Here we will see one efficient way to check whether the nth Fibonacci term is multiple of 10 or not. Suppose the Fibonacci terms are {0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987}. So here 15th (Counting from 0) Fibonacci term is divisible by 10. For 16 it will return true.One easiest method is generating Fibonacci numbers up to given term, and check whether it is divisible by 10 or not? But this solution is not good, because it will not work for larger terms.Another good approach is like below −Fibonacci terms ... Read More
 Data Structure
 Networking
 RDBMS
 Operating System
 Java
 iOS
 HTML
 CSS
 Android
 Python
 C Programming
 C++
 C#
 MongoDB
 MySQL
 Javascript
 PHP