Found 6685 Articles for Javascript

How to Get Value of Selected Radio Button Using JavaScript?

Yaswanth Varma
Updated on 20-Apr-2023 17:10:57

5K+ Views

One of the most important HTML components when attempting to design a form is the radio button. The user can only select one choice from the alternatives shown to him by the radio buttons. Typically, we just utilize the element's value attribute in JavaScript to retrieve an element's value from an HTML webpage. But with radio buttons, we can't do that. The reason is that getting the values of individual radio buttons is a bad idea. Let's get started with the article to learn how to get the value of a selected radio button. For this, we are going to ... Read More

How To Password Protect A Page Using Only HTML, CSS And JavaScript?

Yaswanth Varma
Updated on 20-Apr-2023 16:57:38

14K+ Views

Password protection is an important security measure for webpages that contain sensitive information or require authentication for access. If you want to add extra security to a web page without using a server-side language, you can use HTML, CSS, and JavaScript to password protect the page. This article will show you how to create a simple form that requires users to enter a password before they can view the content of your protected page. Let’s look into the following examples for getting better understanding on protecting a page with password. Example In the following example, we are running the script ... Read More

How to Show Today's Year And Random 4Digit Numbers at the Same Time?

Yaswanth Varma
Updated on 20-Apr-2023 16:44:17

70 Views

Let's see "How to show the current year and a random 4-digit number at the same time." This can be useful for a variety of reasons, such as creating unique identifiers, tracking dates, or displaying the date in a specific format. By using some simple programming techniques, you can quickly create this effect with minimal coding knowledge. Let's explore how to do it in JavaScript. Let’s dive into the article to get a better understanding of displaying today's year and a random 4-digit number at the same time. Using JavaScript random() method The Math.random() static method provides a floating-point, pseudo-random ... Read More

How To Change Text Inside All HTML Tags Using JavaScript

Yaswanth Varma
Updated on 20-Apr-2023 16:15:35

1K+ Views

In this article, we are going to perform the task of changing text inside all HTML tags using JavaScript. Let's dive into the article to learn more about changing text within all HTML, but first, let's define HTML tags. What are HTML tags An HTML tag is a segment of markup language used to denote the start and end of an HTML element in an HTML document. HTML tags, which are a component of an HTML element, assist web browsers in turning HTML documents into web pages. For getting better understanding on changing text inside all HTML tags using JavaScript. ... Read More

How to Detect if An 'IMG' Element Load Has Started And/or a Request Has Been Made to the Server?

Yaswanth Varma
Updated on 20-Apr-2023 15:53:02

194 Views

Sometimes when inserting images into HTML sites, the image may not load for the following reasons − Because of image URL wrong Network issues The task we are going to perform was detecting if an img element load has started and/or request has made to the server. Before this let’s have a quick view on the HTML tag. HTML tag To insert an image into a webpage, use the HTML tag. In modern websites, images are linked to web pages using the element, which contains space for the image. This prevents websites from directly adding ... Read More

How to Get the Content of an HTML Comment Using JavaScript

Yaswanth Varma
Updated on 20-Apr-2023 14:23:56

529 Views

Any web browser ignores a comment, which is a piece of code. It's best practice to add comments to your HTML code, especially for complicated publications, so that anyone looking at the code can easily identify sections of the page and any extra notes. Comments make your code easier to read and understand for you and other users. In between tags, HTML comments are placed. Therefore, the browser will regard any content included in tags as a comment and will do nothing with it. Syntax Following is the syntax for comment - Let’s look into the following examples ... Read More

How Do You Make An If Statement In JavaScript That Checks If A Variable is Equal To A Certain Word?

Yaswanth Varma
Updated on 20-Apr-2023 14:12:38

391 Views

The task we are going to perform in this article is about how do you make an if statement in JavaScript that checks if a variable is equal to a certain word. What is an if...else statement When the condition in the if statement is true, a block of code will be executed. This is a form of conditional statement. The else block will be invoked if the condition is false. In if statements, truthy and falsy values are transformed to true or false. Syntax Following is the syntax for if else statement if (condition is true) { ... Read More

Difference between JavaScript and NodeJS

Pradeep Kumar
Updated on 19-Apr-2023 17:33:08

604 Views

JavaScript is a scripting language which is used to develop HTML pages that are interactive with users. It is usually run on web browsers. NodeJS is a platform or runtime environment using which we can run JavaScript in a system rather than a browser. What is JavaScript? JavaScript is a front-end programming language used in web development. It is a lightweight object oriented scripting language that make the web page dynamic and interactive with users. HTML creates website (structure layer), CSS makes it more attractive (design layer) and JavaScript allows the users to interact with these websites rather than simply ... Read More

Difference between JavaScript and C#

Pradeep Kumar
Updated on 19-Apr-2023 17:31:58

433 Views

Two programming languages that have been widely used in the field of software development are JavaScript and C# (pronounce "C sharp"). Both languages are employed for various purposes and each has its own advantages and disadvantages. The main application of the programming language JavaScript is the creation of websites. It is frequently used to build dynamic and interactive web sites. Because JavaScript is a client-side language, it executes in the client's browser rather than on the server. It is a popular option for novices because it is simple to learn and has a low entry barrier. On the ... Read More

Difference between CSS and JavaScript

Pradeep Kumar
Updated on 19-Apr-2023 17:22:08

2K+ Views

A website is developed using HTML. HTML is the backbone and provides the skeleton for the website. But using HTML alone, we can’t create our desired website. Cascade styling sheets is another language that adds another layer to the website. It applies formatting to the website, changes the layout of the website and makes the website appear beautiful. JavaScript is a programming language that makes a website functionable. It adds animations, pop up screens and a lot more to interact with the user. What is CSS? CSS stands for Cascading Style Sheets. CSS is a language which is used ... Read More

Advertisements