Create Valid HTML Document Without Body and Head Elements

Amit Sharma
Updated on 15-Jun-2020 11:45:48

411 Views

With HTML, the essentials are doctype declaration, and . But, you will be amazed to know that a valid HTML document can work without the and element. The doctype declaration will come always since it tells and instructs the browser about what the page is about.Let’s see an example; here we won’t use the html> and element. Still, the HTML Document is valid and will work correctly like any other valid HTML Document − Title of the page This is heading 1 This is heading 2 This is a paragraph.

Draw a Circular Gradient in HTML5

Lakshmi Srinivas
Updated on 15-Jun-2020 11:43:34

280 Views

This method returns a CanvasGradient object that represents a radial gradient that paints along the cone given by the circles represented by the arguments. The first three arguments define a circle with coordinates (x1, y1) and radius r1 and the second a circle with coordinates (x2, y2) and radius r2.createRadialGradient(x0, y0, r0, x1, y1, r1)Here are the parameter values of the createRadialGradient() method −S.NoParameter & Description1x0x-coordinate- Starting point of the gradient2y0y- coordinate - Starting point of the gradient3r0Radius of the starting circle4x1x-coordinate - Ending point of the gradient5y1y- coordinate - Ending point of the gradient6r1Radius of the ending circleYou can ... Read More

Difference Between Old Style and New Style Classes in Python

Rajendra Dharmkar
Updated on 15-Jun-2020 11:41:27

667 Views

In Python 2.x there's two styles of classes depending on the presence or absence of a built-in type as a base-class −"classic" style or old style classes have no built-in type as a base class: >>> class OldSpam:      # no base class ...     pass >>> OldSpam.__bases__ ()"New" style classes: they have a built-in type as a base class meaning that, directly or indirectly, they have object as a base class −>>> class NewSpam(object):           # directly inherit from object ...    pass >>> NewSpam.__bases__ (, ) >>> class IntSpam(int):       ... Read More

Creating a Graph in Javascript

karthikeya Boyini
Updated on 15-Jun-2020 11:36:09

1K+ Views

We'll be creating a graph class that supports weights and both directed and undirected types. This will be implemented using an adjacency list. As we move to more advanced concepts, both weights and directed nature of the graphs will come in handy.An adjacency list is an array A of separate lists. Each element of the array Ai is a list, which contains all the vertices that are adjacent to vertex i. We're defining it using 2 members, nodes and edges.Let's set up the graph class by defining our class and some methods that we'll use to add nodes and edges ... Read More

Graph Traversals in Javascript

Sai Subramanyam
Updated on 15-Jun-2020 11:34:08

240 Views

Graph traversal (also known as graph search) refers to the process of visiting (checking and/or updating) each vertex in a graph. Such traversals are classified by the order in which the vertices are visited.

Breadth First Search Traversal in JavaScript

karthikeya Boyini
Updated on 15-Jun-2020 11:33:43

4K+ Views

BFS visits the neighbor vertices before visiting the child vertices, and a queue is used in the search process. Following is how a BFS works −Visit the adjacent unvisited vertex. Mark it as visited. Display it. Insert it in a queue.If no adjacent vertex is found, remove the first vertex from the queue.Repeat Rule 1 and Rule 2 until the queue is empty.Let us look at an illustration of how BFS Traversal works:StepTraversalDescription1Initialize the queue.2We start by visiting S (starting node) and mark it as visited.3We then see an unvisited adjacent node from S. In this example, we have three ... Read More

Use enctype Attribute in HTML Forms

karthikeya Boyini
Updated on 15-Jun-2020 11:32:52

243 Views

The formenctype attribute is used to show how the form data should be encoded when it is submitting to the server. It introduced in HTML5 and only used with input type submit an image.Here are the formenctype attribute values −S.NoValue & Description1application/x-www-form-urlencodedThis is the default. All the characters are encoded before sent.2multipart/form-dataNone of the characters are encoded.3text/plainIn this, the spaces are converted to + symbols. However, no special characters are encoded.ExampleYou can try to run the following code to learn how to use the formenctype attribute in HTML.           HTML formenctype attribute                        Name                    

Use formtarget Attribute in HTML

Krantik Chavan
Updated on 15-Jun-2020 11:32:18

264 Views

The formtarget attribute in HTML is used to indicate where the response that is received after the form submission is displayed. It overrides the target attribute of the HTML form tag. Use the formtarget attribute only with input type submit an image.Here are the attribute values of the formtarget attribute −S. NoValueDescription1_blankResponse gets displayed in a new window or tab2_selfThe default value. The response gets displayed in the same frame.3_parentResponse gets displayed in the parent frame4_topResponse gets displayed in the full body of the window5framenameResponse gets displayed in a named iframeExampleYou can try to run the following code to learn ... Read More

Node in JavaScript

Sai Subramanyam
Updated on 15-Jun-2020 11:31:41

221 Views

Each element in a tree is a node. We need to define a node before we proceed to define a binary tree as a tree consists of nodes. We'll create a very simple node definition that has 3 properties, namely: left, right and data.left − This holds the reference to the left child of this node.right − This holds the reference to the right child of this node.data − This holds the reference to the data we want to store in this node.Let us see the code representation of such a structure.Examleclass Node {    constructor(data, left = null, right ... Read More

Why FormAction Attribute is Not Working Outside of Form Tag

Sharon Christine
Updated on 15-Jun-2020 11:31:20

755 Views

We can make the formaction attribute to work outside the tag. The formaction attribute is used to specify more than one submit URLs for one form. When you submit a form, the web browser first checks for a formaction attribute.If the formaction is not present, the web browser moves on to look for an action attribute on the form element.ExampleHere’s an example of the formaction attribute with three different submit buttons −           HTML formaction attribute                                  Button1 ... Read More

Advertisements