Sravani S has Published 95 Articles

Set the width of the element in HTML

Sravani S

Sravani S

Updated on 24-Jun-2020 12:04:06

Use the width attribute in HTML to set the width of an element. You can use the attribute with the following elements − , , , , , etc.ExampleYou can try to run the following code to implement width attribute in HTML − Live Demo                                        Your browser does not support the video element.           Output

How to indicate long quotations in an HTML document?

Sravani S

Sravani S

Updated on 24-Jun-2020 08:40:01

Use the tag to indicate long quotations. The HTML tag is used to include long quotations (i.e. quotations that span multiple lines). It should contain only block-level elements within it and not just plain text.The following is the attribute −AttributeValueDescriptioncite URLURL of the quote, if it is taken ... Read More

Create an ordered list in HTML

Sravani S

Sravani S

Updated on 24-Jun-2020 08:36:04

The HTML tag is used for creating an ordered list. You can try to run the following code to create an ordered list using the tag −The HTML tag supports the following additional attributes −AttributeValueDescriptioncompactautofocusDefines if compact rendering is required.reversed reversedSpecifies the order of the list (descending).start ... Read More

How do we display the main content in the document in HTML5?

Sravani S

Sravani S

Updated on 24-Jun-2020 08:00:11

The HTML tag specifies main or important content in the document. It can be used only once per page and can't be used as a descendent of , , , , element.ExampleYou can try to run the following code to learn how to display the main content in ... Read More

How to display JavaScript variables in an HTML page without document.write?

Sravani S

Sravani S

Updated on 24-Jun-2020 06:42:02

Use Element.innerHTML in JavaScript to display JavaScript variables in an HTML page without document.write.You can try to work through the following code snippet −var $myName = document.querySelector('.name'); var $jsValue = document.querySelector('.jsValue'); $myName.addEventListener('input', function(event){    $jsValue.innerHTML = $myName.value; }, false);

How to detect integer overflow in C++?

Sravani S

Sravani S

Updated on 24-Jun-2020 06:01:55

The only safe way is to check for overflow before it occurs. There are some hacky ways of checking for integer overflow though. So if you're aiming for detecting overflow in unsigned int addition, you can check if the result is actually lesser than either value-added. So for example, unsigned ... Read More

How to compare float and double in C++?

Sravani S

Sravani S

Updated on 24-Jun-2020 05:41:44

Comparing floats and double variables depends on what your end goal is. If you want a runnable function without going too much in details and won't have a problem in some inaccurate calculations you can use the following function −Example#include using namespace std; // Define the error that you ... Read More

What is the use of the '&' symbol in C++?

Sravani S

Sravani S

Updated on 23-Jun-2020 13:41:40

The & symbol is used as an operator in C++. It is used in 2 different places, one as a bitwise and operator and one as a pointer address of operator.Bitwise ANDThe bitwise AND operator (&) compares each bit of the first operand to that bit of the second operand. ... Read More

How to define global variable in a JavaScript function?

Sravani S

Sravani S

Updated on 23-Jun-2020 11:56:54

To declare a global variable, use the var at global scope −    var myGlobalVariable;    function display() {       //    } For JavaScript function, assign the property to a window −    function display() {       window. myGlobalVariable = …;    }

How to set the shadow effect of a text with JavaScript?

Sravani S

Sravani S

Updated on 23-Jun-2020 11:23:38

To set the shadow effect, use the textShadow property in JavaScript.ExampleYou can try to run the following code to return the shadow effect of a text with JavaScript −           Set Text Shadow                This is Demo Text! ... Read More

1 2 3 4 5 ... 10 Next
Advertisements