How can I delete all cookies with JavaScript?

Vrundesha Joshi
Published on 30-Jan-2018 09:32:43
To delete all cookies with JavaScript, you can try to run the following code. Here, we’re using an array and the split() method to get all the cookies and finally delete themExampleLive Demo<!DOCTYPE html> <html>    <head>       <script>          var num = 1;   ... Read More

How to create object properties in JavaScript?

Daniol Thomas
Published on 01-Feb-2018 10:36:21
Object properties can be any of the three primitive data types, or any of the abstract data types, such as another object. Object properties are usually variables used internally in the object's methods, but can also be globally visible variables that are used throughout the page.The syntax for adding a ... Read More

How to use blockquote in HTML?

Sharon Christine
Published on 18-Jan-2018 06:35:02
The <blockquote> tag is to indicate long quotations. It should contain only block-level elements within it and not just plain text. It specifies a section quoted from another source and contains only block-level elements.The <blockquote> tag also has an attribute, cite, which is used to specify the source of the ... Read More

How to use quotation marks in HTML?

Swarali Sree
Published on 18-Jan-2018 06:31:19
The <q> tag is used to add short quotation marks in HTML. Just keep in mind if the quotation goes for multiple lines, use <blockquote> tag. Browsers usually insert quotation marks around the q element.You can also use the cite attribute to indicate the source of the quotation in URL ... Read More

How can I show a euro or other HTML entity in JavaScript alert windows?

Vrundesha Joshi
Published on 01-Feb-2018 10:57:14
Yes, use the Unicode Character of Euro i.e. “20AC” to print it.ExampleYou can try to run the following code to print the Euro character −Live Demo<!DOCTYPE html> <html>    <body>       <script>          alert("\u20AC");          document.write("\u20AC");       </script>     ... Read More

How to get the current URL with JavaScript?

Published on 30-Jan-2018 11:59:41
To get the current URL with JavaScript, use window.location.href property −ExampleLive Demo<!DOCTYPE html> <html>    <body>       <h3>Get current URL</h3>       <p id="test"></p>       <script>          document.getElementById("test").innerHTML = "URL of the page: " + window.location.href;       </script>    </body> ... Read More

How to set multiple cookies in JavaScript?

Published on 30-Jan-2018 11:57:11
With JavaScript, to set more than one cookie, set document.cookie more than once using the; separator.ExampleYou can try to run the following code to set multiple cookies −Live Demo<!DOCTYPE html> <html>    <head>       <script>       var num=1;       function addCookie() {     ... Read More

How to mark text superscript in HTML?

Paul Richard
Published on 23-Apr-2018 10:57:20
To mark superscripted text in HTML, use the <sup>…</sup> tag. Just keep in mind both the opening and closing tag is mandatory while using the <sup>...</sup> tag.The superscript text appears to be half a character above the normal line. It is displayed as a smaller font.You can try the following ... Read More

How to create JavaScript objects using new operator?

Krantik Chavan
Published on 01-Feb-2018 10:33:07
The new keyword in JavaScript is the new operator, which creates an instance of a user-defined object type.ExampleYou can try to run the following code to create JavaScript objects using new operator −Live Demo<!DOCTYPE html> <html>    <body>       <p id = "test"></p>       <script>   ... Read More

How to mark inserted text in HTML?

Samual Sam
Published on 18-Jan-2018 06:13:10
To mark inserted text in HTML, use the <ins>…</ins> tag. This is crucial in finding the differences between multiple versions of the same document. Also, use it to signify a range of text added to a document.ExampleYou can try to run the following code to mark inserted text in HTML<!DOCTYPE ... Read More