Found 6685 Articles for Javascript

How to change text font in HTML?

Sai Subramanyam
Updated on 06-Sep-2023 14:02:36

43K+ Views

To change the text font in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML tag, with the CSS property font-family, font-size, font-style, etc.HTML5 do not support the tag, so the CSS style is used to change font. The tag deprecated in HTML5.Just keep in mind, the usage of style attribute overrides any style set globally. It will override any style set in the HTML tag or external style sheet.ExampleYou can try to run the following code to change the font in HTMLLive ... Read More

How to set src to the img tag in HTML from another domain?

Akshaya Akki
Updated on 09-Jan-2020 08:54:02

2K+ Views

To use an image on a webpage, use the tag. The tag allows you to add image source, alt, width, height, etc. The src is to add the image URL. The alt is the alternate text attribute, which is text that is visible when the image fails to load. With HTML, add the image source as another domain URL. For that, add the src attribute as a link to another domain.The following are the attributes:Sr.No.Attribute & Description1altThe alternate text for the image2heightThe height of the image3ismapThe image as a server-side image-map4longdescThe URL to a detailed description of an image5srcThe ... Read More

What is the use of JavaScript cookies?

Giri Raju
Updated on 09-Jan-2020 08:33:06

168 Views

Using cookies is the most efficient method of remembering and tracking preferences, purchases, commissions, and other information required for better visitor experience or site statistics.Your server sends some data to the visitor's browser in the form of a cookie. The browser may accept the cookie. If it does, it is stored as a plain text record on the visitor's hard drive. Now, when the visitor arrives at another page on your site, the browser sends the same cookie to the server for retrieval. Once retrieved, your server knows/remembers what was stored earlier.Cookies are a plain text data record of 5 ... Read More

How to set a cookie and get a cookie with JavaScript?

Sreemaha
Updated on 16-Jun-2020 11:56:32

3K+ Views

Set CookieThe simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this:document.cookie = "key1=value1;key2=value2;expires=date";Here the “expires” attribute is optional. If you provide this attribute with a valid date or time, then the cookie will expire on a given date or time and thereafter, the cookies' value will not be accessible.ExampleTry the following. It sets a customer name in an input cookie.Live Demo                                                  Enter ... Read More

How to make text italic in HTML?

Lakshmi Srinivas
Updated on 09-Jan-2020 08:31:12

16K+ Views

To make text italic in HTML, use the … tag or … tag. Both the tags have the same functioning, but tag is a phrase tag, which renders as emphasized text.Just keep in mind that you can get the same result in HTML with CSS font-style property.ExampleYou can try to run the following code to make text italic in HTML using … tagLive Demo           HTML italic text               Products                Our products: Online HTML Editor and Online Image Editor. ... Read More

How to set JavaScript Cookie with no expiration date?

Prabhdeep Singh
Updated on 07-Nov-2022 08:25:24

1K+ Views

In this tutorial, we are going to learn to set a JavaScript cookie with no expiration date. Web servers deliver cookies, which are tiny files with frequently unique identifiers, to browsers. Each time your browser requests a new page, the server will receive these cookies. It allows a website to keep track of your preferences and online behavior. The expiration option in a JavaScript cookie is optional. The “expires” attribute is optional. If you provide this attribute with a valid date or time, then the cookie will expire on a given date or time, and thereafter, the cookies' value will ... Read More

How do I create and read a value from the cookie in JavaScript?

usharani
Updated on 16-Jun-2020 11:50:52

109 Views

Create cookiesThe simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this −document.cookie = "key1=value1;key2=value2;expires=date";Here the “expires” attribute is optional. If you provide this attribute with a valid date or time, then the cookie will expire on a given date or time and thereafter, the cookies' value will not be accessible.ExampleTry the following. It sets a customer name in an input cookie.Live Demo                                                 ... Read More

How to make text bold in HTML?

Monica Mona
Updated on 06-Sep-2023 14:16:19

39K+ Views

To make text bold in HTML, use the … tag or … tag. Both the tags have the same functioning, but tag adds semantic strong importance to the text. The tag is a physical markup element, but do not add semantic importance.Just keep in mind that you can get the same result in HTML with CSS font-weight property.ExampleYou can try to run the following code to make text bold in HTML using … tagLive Demo           HTML text bold               Our Products       Developed ... Read More

How to set src to the img tag in html from the system drive?

Manikanth Mani
Updated on 09-Jan-2020 08:42:43

18K+ Views

To use an image on a webpage, use the tag. The tag allows you to add image source, alt, width, height, etc. The src is to add the image URL. The alt is the alternate text attribute, which is text that is visible when the image fails to load.With HTML, add the image source as the path of your system drive. For that, add the src attribute as a link to the path of system drive where the image is stored. For example, file:/D:/images/logo.pngThe following are the attributes:Sr.No.Attribute & Description1AltThe alternate text for the image2HeightThe height of the image3IsmapThe ... Read More

How do I print Unicode characters in the console using JavaScript?

Shubham Vora
Updated on 22-Jul-2022 12:55:58

3K+ Views

In this article, we will learn how to print Unicode characters in the console using JavaScript. No matter the platform, the software, or the language, Unicode assigns a unique number to each character.Most writing systems' characters are defined by the universal character set known as Unicode, which also assigns each character a unique number (code point). A unit of data called an abstract character (or character) is used to organize, manage, or represent textual data.Most of the modern languages' letters, punctuation marks, diacritical markings, mathematical symbols, technical symbols, arrows, emoji, and other symbols are all included in Unicode.These are different ... Read More

Advertisements