Javascript Articles

Page 117 of 534

How can I set the default value for an HTML \'select\' element?

usharani
usharani
Updated on 20-Sep-2024 865 Views

To set the default value for an HTML element, we can use HTML selected attribute. It is used when you want to display a predefined value on your drop down menu. In this article we are having a dropdown list of four options, our task is to set the default value for an HTML select element. Steps to Set Default Value for select Element We will be following below mentioned steps to set the default value for HTML select element: We have created a dropdown list using select tag and then added options ...

Read More

Convert text to lowercase with CSS

Samual Sam
Samual Sam
Updated on 11-Sep-2024 4K+ Views

To convert text to lowercase with CSS, we will be using the lowercase value of text-transform property. Example In this example, we are using text-transform property and displaying the result as before and after the conversion using p tag. #lcase{ text-transform:lowercase; } Convert Text ...

Read More

How to show images with a click in JavaScript using HTML?

Kalyan Mishra
Kalyan Mishra
Updated on 11-Sep-2024 38K+ Views

To display images on click using JavaScript and HTML. This article covers creating hidden images, adding click events, and revealing images dynamically for an interactive user experience. Users want to create an interactive web page where images are initially hidden and can be revealed with a click, enhancing user engagement and page load times. The challenge is implementing this functionality using JavaScript and HTML simply and efficiently. Approaches to Show Images with a Click Using the Style Display Property Using the classList.toggle() Method Using Hidden ...

Read More

JavaScript in filter an associative array with another array

Shriansh Kumar
Shriansh Kumar
Updated on 11-Sep-2024 1K+ Views

In this problem statement, our task is to write a JavaScript program by which we can simply filter an associative array with the help of another array. Before discussing the solution for the given problem, let's familiarize ourselves with associative array first. What is an associative array? An associative array is a data structure which is used to store the key and value pairs. In this each key is associated with a value given to the key. The keys in this array are unique identifiers that can be used to retrieve their respective values. In an associative array the keys ...

Read More

What are the advantages of CSS?

Ankitha Reddy
Ankitha Reddy
Updated on 28-Aug-2024 17K+ Views

CSS or Cascading Style Sheets is used to design the web pages, it helps web developers to control the layout and other visual aspects of the web pages. Using CSS, you can control the color of the text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out, what background images or colors are used. In this article, we will be discussing various advatages of CSS Advantages of CSS Consistent Design: By using CSS, we can use same design across an entire website or on various web pages. This reduces ...

Read More

How to hide a navigation menu on scroll down with CSS and JavaScript?

Aman Kumar
Aman Kumar
Updated on 19-Aug-2024 6K+ Views

To hide a navigation menu on scroll down with CSS and JavaScript, user should have basic knowledge of javascript conditional statement and CSS. We will be creating the navigation menu using HTML, style the navigation menu using CSS and use Javascript to hide navigation menu while scrolling down. We are having a navigation menu with textual content, our task is to hide the navigation menu while scrolling down. In this article, we will be implementing following steps to hide a navigation menu on scroll down with CSS and JavaScript: Creating Structure of Navigation Menu Using ...

Read More

Top 8 JavaScript Books For Beginners to Advanced

vivek Raj Singh
vivek Raj Singh
Updated on 19-Aug-2024 512 Views

JavaScript is a versatile, powerful language that can also be used for server-side scripting, opening up numerous career opportunities in web development. Understanding JavaScript is essential whether you're just starting out or already on your coding journey. The recommended books below offer various approaches to mastering JavaScript, helping you become a more creative and effective developer. Top 8 JavaScript Books For Beginners to Advanced Here are my top 8 book recommendations for mastering JavaScript. Whether you're a beginner or an experienced developer, there's something valuable for everyone on this list. JavaScript: The Good Parts ...

Read More

How to Create StopWatch using HTML CSS and JavaScript ?

Eesha Gandhi
Eesha Gandhi
Updated on 07-Aug-2024 6K+ Views

To create Stopwatch using HTML, CSS, and Javascript, we need to have basic understanding of working of HTML, CSS and JavaScript. HTML and CSS will be used to make UI of stopwatch where HTML will create structure of stopwatch, CSS styles the stopwatch and Javascript will be adding functionality to our stopwatch. In this tutorial, we will understand how to create stopwatch with the functionality of Start, Stop and Reset, using HTML, CSS, and JavaScript. We'll be following three steps: Creating structure of stopwatch using HTML Designing the structure using CSS ...

Read More

How to create a line break with JavaScript?

Giri Raju
Giri Raju
Updated on 07-Aug-2024 42K+ Views

To create a line break with JavaScript, we will be understanding three different approaches. In this article, we are having some text content and our task is to create line break using Javascript. We will be using tag, \n and insertAdjacentHTML() method along with block elements with explaination and example codes for each. Approaches to Create a Line Break with JavaScript Line Break Using br tag Line Break new line Character Line Break Using insertAdjacentHTML() Method Line Break Using br tag In this approach to ...

Read More

JavaScript clearTimeout() & clearInterval() Method

Shriansh Kumar
Shriansh Kumar
Updated on 30-Jul-2024 2K+ Views

In JavaScript, the clearTimeout() and clearInterval() methods are used to clear timers. When we set a timer using setTimeout() or setInterval() methods, the browser allocates memory to track it. Therefore, we use these methods to release that memory and avoid unnecessary function calls. It is best practice to clear timers when they are no longer needed. In this article, we will learn how the clearTimeout() and clearInterval() methods help to clear timers. JavaScript clearTimeout() method The clearTimeout() method in JavaScript clears the timeout that has been previously set by the setTimeout() function. It accepts a single integer value as a ...

Read More
Showing 1161–1170 of 5,338 articles
« Prev 1 115 116 117 118 119 534 Next »
Advertisements