Learn JSX Expressions and Variables in React with Examples 2026

Image
JSX Expressions and Variables in React 1. Introduction to JSX Expressions and Variables React is a popular JavaScript library used to build modern and interactive user interfaces. While developing React applications, developers frequently work with JSX, which makes writing UI components easier and more readable. JSX stands for JavaScript XML. It allows developers to write HTML-like syntax inside JavaScript code. However, JSX is not limited to displaying static HTML elements. It also allows developers to use JavaScript expressions and variables to display dynamic information. JSX expressions and variables are important concepts for every React beginner. They help developers display usernames, product prices, calculations, messages, and other changing data on a webpage. For example, instead of writing the same text directly inside every component, developers can store information in variables and display it wherever required. In this tutorial, you will learn what JSX expressions and vari...

How to Add Audio in HTML Using audio Tag

How to Add Audio in HTML Using audio Tag


html audio tag



Learn HTML audio  Tag 

The <audio> has been added to HTML5 to allow embedding audio files to a web page.

  not all browsers support all audio format the audio file is encoded using special codecs.

 The <source> tag or the src attribute is used to indicate the variations of the same audio file.

 The path to  audio file can contain absolute  and relative URL.

Syntax: The <audio> tag comes in pairs; the content is written between the opening (<audio>) and the closing (</audio>) tags.

Syntax 

<audio controls>
 <source src="/desktop/audio_friendship.mp3" type="audio">
</audio>

Learn HTML audio  Tag 

Example 

<html>

Click the play button

 <title>Title of the document</title>

 <head>

 </head>

<body>

<audio controls>

 <source src="/desktop/audio_friendship.mp3" type="audio">

</audio>

<P>click the Play button</p>

</body>

</html>

Learn HTML audio  Tag 

Explain program 

Step 1 ]

<!Doctype html>

  • <!doctype html>  always be the first line of any HTML document.

Step 2 ]

   <html> and </html>

   html  is the root element.

Step 3 ]

<body> and </body>

body  is  main content area.

All visible content inside to  the <body> tag

Step 4]

<audio controls>

create audio player the page

controls attribute add play/pause button

Step 5]

<source src="/desktop/audio_friendship.mp3" type="audio">
 
src   :-  file pointer to the location (here desktop/audio_friendship.mp3)


Learn HTML audio  Tag 

Output 

learn html Audio Tag

Related Post :-




Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

CSS Outline Offset Property with Practical Examples