Found 2556 Articles for HTML

How to add an address element in HTML?

Yaswanth Varma
Updated on 02-Sep-2022 11:21:48

598 Views

The address tag in HTML identifies a person's or an organization's contact details. The address tag has several meanings when used in different places in an HTML page, such as, when it is used within the tag, it will display the document's contact information; and if it appears inside the tag, it stands in for the article's contact details. This tag will only take global attributes. These attributes belong to every element in the HTML document even though some elements won’t be affected with these. Syntax Address... Note − The address tag must always ... Read More

How to use inline CSS style for an element in HTML?

Yaswanth Varma
Updated on 02-Sep-2022 11:18:54

287 Views

Using inline CSS we can apply a distinct style to one HTML element at a time. This can be done using the style attribute. Inline CSS always overrides style properties determined in internal or external style sheets. Syntax Following are the examples… Example In the following example we are applying inline style defined within the style attribute of relevant element DOCTYPE html> Hello Everyone Welcome to Tutorialspoint On executing the above script the incline css get activated and applied to the elements in the text. Using JavaScript ... Read More

Create a shortcut key to activate an element in HTML

Yaswanth Varma
Updated on 02-Sep-2022 11:16:45

3K+ Views

We can design a keyboard shortcut to carry out certain actions, such clicking a link or button, for Displaying the Keyboard text. When defining the element, we may utilise the accesskey attribute to specify a keyboard shortcut for that control element. This attribute must contain at least one printable character, including the accented/other characters that can be inputted using a keyboard. However, different browsers use different ways to activate the accesskey on its platform − Windows Linux INTERNET EXPLORER Alt + key Alt + Shift + key N/A MOZILLA ... Read More

Using more than one CSS classes for an element in HTML

Yaswanth Varma
Updated on 02-Sep-2022 11:13:26

116 Views

To create CSS more quickly, we can give a single HTML element numerous classes and style each class separately. This method allows us to manage style application redundancy. We can apply the universal styles to many classes and the particular class-specific styles. Syntax Example In the following example we are using the style of class”Varma” to both of the paragraphs while the style of secondclass varma1 is applied to second paragraph. DOCTYPE html> .varma { font-size: larger; ... Read More

How to use sockets in JavaScriptHTML?

Ankitha Reddy
Updated on 30-Jul-2019 22:30:22

142 Views

To use sockets, consider the WebSocket interface in JavaScript. This interface enables web applications to maintain bidirectional communications with server-side processes. To enable Web applications to maintain bidirectional communications with server-side processes, this specification introduces the WebSocket interface. Here are some of the methods to workaround with Web Sockets − socket = new WebSocket(url [, protocols ] ) Create a new socket using this, wherein parameters URL is a string for the connection and protocols is a string or array of string. socket . send( data ) The above is used to send data. Used to ... Read More

How to get the value of the usemap attribute of an image with JavaScript?

Sravani S
Updated on 23-Jun-2020 11:03:29

105 Views

To get the value of the usemap attribute of an image, use the useMap property. You can try to run the following code to display the usemap attribute value −Example                                                var x = document.getElementById("myid").useMap;          document.write("Usemap: "+x);          

How to set all the border bottom properties in one declaration in JavaScript DOM?

Lakshmi Srinivas
Updated on 23-Jun-2020 11:07:31

71 Views

To set the border bottom properties in one declaration in JavaScript, use the borderBottom property. It allows you to set the border-bottom-width, border-bottom-style, and border-bottom-color.ExampleYou can try to run the following code to learn how to set border bottom properties −Live Demo                    #box {             border: 2px dashed blue;             width: 120px;             height: 120px;          }                     Set border bottom color                Demo Text          Demo Text                      function display() {             document.getElementById("box").style.borderBottom = "thin dashed #000000";          }          

What will happen when ["demo"] is converted to Number in JavaScript?

karthikeya Boyini
Updated on 23-Jun-2020 09:58:50

51 Views

Use the Number() method in JavaScript to convert to Number. You can try to run the following code to learn how to convert ["demo"] to Number in JavaScript −ExampleLive Demo           Convert ["demo"] to Number                var myVal = ["demo"];          document.write("Number: " + Number(myVal));          

How to set the starting position of a background image in JavaScript DOM?

Sharon Christine
Updated on 23-Jun-2020 10:00:38

294 Views

To set the starting position of a background image in JavaScript, use the backgroundposition property. It allows you to set the position of the image.ExampleYou can try to run the following code to learn how to set all the position of a background image with JavaScript −Live Demo                    body {             background-repeat: no-repeat;          }                     Click to Set background image                function display() {             document.body.style.backgroundImage = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg')";             document.body.style.backgroundPosition="top right";          }          

What will happen when 1 is converted to Boolean in JavaScript?

Paul Richard
Updated on 23-Jun-2020 09:20:39

64 Views

You can try to run the following code to learn how to convert 1 to Boolean in JavaScript −ExampleLive Demo           Convert 1 to Boolean                var myVal = 1;          document.write("Boolean: " + Boolean(myVal));          

Advertisements