Abhishek Kumar has Published 18 Articles

How to show the number of links in a document with JavaScript?

Abhishek Kumar

Abhishek Kumar

Updated on 21-Sep-2022 07:58:03

527 Views

We use the links property of the document object to show the number of links in a document with JavaScript. The document object, part of the DOM, corresponds to the current web page that the browser has loaded. It Contains all the information about the condition of the browser as ... Read More

How to show the index of the selected option in a dropdown list with JavaScript?

Abhishek Kumar

Abhishek Kumar

Updated on 21-Sep-2022 07:48:25

10K+ Views

We use the selectedIndex property in JavaScript to show the index of the selected option in a dropdown list. We use the id of the dropdown list to access the element using JavaScript and then call selectedIndex on it to get the index of the selected option in the dropdown ... Read More

How to show the full URL of a document with JavaScript?

Abhishek Kumar

Abhishek Kumar

Updated on 21-Sep-2022 07:46:36

1K+ Views

We use the URL property of the document object to show the full URL of a document with JavaScript. The document object, part of the DOM, corresponds to the current web page that the browser has loaded. It Contains all the information about the condition of the browser as well ... Read More

How to create many Javascript variables in a single statement?

Abhishek Kumar

Abhishek Kumar

Updated on 21-Sep-2022 07:43:33

6K+ Views

We can create many JavaScript variables in a single statement using the var, let, and const keywords that are used for declaring variables in JavaScript. Instead of declaring every variable individually, we can chain many variables together with commas (, ) in a single statement. Since JavaScript is a loosely ... Read More

How to show the domain name of the server that loaded the document with JavaScript?

Abhishek Kumar

Abhishek Kumar

Updated on 21-Sep-2022 07:40:55

2K+ Views

We use the window.location.hostname property of the document object to show the domain name of the server that loaded the document using JavaScript. The document object, part of the DOM, corresponds to the current web page that the browser has loaded. It Contains all the information about the condition of ... Read More

How to show the date and time the document was last modified with JavaScript?

Abhishek Kumar

Abhishek Kumar

Updated on 21-Sep-2022 07:38:53

4K+ Views

We use the lastModified property of the document object to show the date and time the document was last modified with JavaScript. This command will provide the exact date and time of modification. The document object, part of the DOM, renders the whole HTML as a hierarchy of objects and ... Read More

How to show name/value pairs of cookies in a document with JavaScript?

Abhishek Kumar

Abhishek Kumar

Updated on 21-Sep-2022 07:34:32

617 Views

We use the cookie property of the document object to show the name/value pairs of cookies in a document with JavaScript. The document object, part of the DOM, corresponds to the current web page that the browser has loaded. It Contains all the information about the condition of the browser ... Read More

How to show hyperlinks in JavaScript alert?

Abhishek Kumar

Abhishek Kumar

Updated on 21-Sep-2022 07:30:51

7K+ Views

We use the dialog API of jQuery UI to show hyperlinks in JavaScript alerts. JavaScript does not allow putting clickable hyperlinks in the alert box. The closest functionality that plain JavaScript provides is a confirm box using the window.confirm() method. We will be using the jQuery library to show hyperlinks ... Read More

Advertisements