How to use small formatting in HTML?

Sharon Christine
Published on 18-Jan-2018 05:38:18
Small font is used to define small formatting. For small formatting, use the HTML <small> tag. The text inside the <small>…</small> tag will get a smaller font.Just keep in mind to use the <small>...</small> tag inside the <p>…</p> tag.ExampleYou can try the following code to use small formatting in an ... Read More

How to print a number with commas as thousands of separators in JavaScript?

Published on 01-Feb-2018 10:38:42
To print a number with commas as thousands of separators, try to run the following code −ExampleLive Demo<!DOCTYPE html> <html>    <body>       <script>          var number = 24287995;          document.write(new Intl.NumberFormat().format(number));       </script>    </body> </html>Output24, 287, 995Read More

How to create tables in HTML?

Manikanth Mani
Published on 18-Jan-2018 07:14:09
To create table in HTML, use the <table> tag. A table consist of rows and columns, which can be set using one or more <tr>, <th>, and <td> elements. A table row is defined by the <tr> tag. To set table header, use the <th> tag. For a table cell, ... Read More

How to set named cookies in JavaScript?

Published on 30-Jan-2018 12:07:06
To set named cookie in JavaScript, run the following code. It sets a customer name in an input cookie.ExampleLive Demo<html>    <head>       <script>          <!--             function WriteCookie() {                if( document.myform.customer.value == ... Read More

How to use Emphasized formatting in HTML?

Swarali Sree
Published on 17-Jan-2018 13:25:03
To use emphasized formatting in HTML, the <em>…</em> a tag is used. It defines the emphasized text and adds semantic importance. Just keep in mind; it is a phrase tag, which renders as emphasized text.You can try to run the following code to use the emphasized formatting in HTML using ... Read More

Is there a way to print all methods of an object in JavaScript?

Rahul Sharma
Published on 01-Feb-2018 10:37:10
To get all the method, use Object.getOwnPropertyNames(). This returs all properties that belong to an object.ExampleYou can try to run the following code to get all methods −Live Demo<!DOCTYPE html> <html>    <body>       <script>          document.write("<br>"+Object.getOwnPropertyNames(Math).filter(function (p) {             ... Read More

What is cross-browser window resize events in JavaScript?

Published on 30-Jan-2018 12:19:36
For window resize event in JavaScript, use addEventListener(). The following code will give you the size of the current window −ExampleLive Demo<!DOCTYPE html> <html>    <head>       <style>          div {             margin-top: 10px;             ... Read More

How to set text font family in HTML?

Samual Sam
Published on 17-Jan-2018 13:21:26
To change the text font family in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property font-family. HTML5 do not support the <font> tag, so the CSS style is used to ... Read More

How to use floating image in HTML page?

Alankritha Ammu
Published on 18-Jan-2018 07:04:02
To use a floating image in HTML, use the CSS property float. It allows you to float an image left or right. More property values include the following:Sr.No.Property Value & Description1noneNot floated2leftFloats to the left3rightFloats to the right4initialDefault valueExampleYou can try to run the following code to use floating image ... Read More

How can I trigger a JavaScript click event?

Published on 30-Jan-2018 12:12:19
To trigger a JavaScript click event, let us see the example of mouse hover.ExampleLive Demo<!DOCTYPE html> <html>    <body>       <p>Hover over the button.</p>       <form>          <input type="button" id="test" value="Hover" onmouseover="display()" onclick="alert('click event')">       </form>       <script>   ... Read More