Found 601 Articles for Front End Scripts

How to add background music to your web page?

Vikyath Ram
Updated on 13-Sep-2023 15:40:09

31K+ Views

To add background music on a web page, use … element. Also, use the autoplay attribute. This will run music in the background whenever the page loads.Set the width and height in a way the player hides on the web page. The loop attribute is added to specify whether the audio will start over again. Add the music file to the server and mention the link in src attribute.ExampleYou can try to run the following code to add background music to your web page:Live Demo           HTML background music             ... Read More

How to draw a star in HTML5 SVG?

Govinda Sai
Updated on 16-Dec-2021 09:34:31

6K+ Views

SVG stands for Scalable Vector Graphics and is a language for describing 2D-graphics and graphical applications in XML and the XML is then rendered by an SVG viewer. Most of the web browsers can display SVG just like they can display PNG, GIF, and JPG.To draw a polygon in HTML SVG, use the SVG element. The element creates a graphic containing at least three sides. For drawing a star in HTML5 SVG, you need to set the x and y coordinates properly for each corner.ExampleYou can try to run the following code to learn how to draw a ... Read More

How to use .svg files in a webpage?

Swarali Sree
Updated on 26-Jun-2020 06:33:18

566 Views

The svg files are Scalable Vector Graphics. You can add it to a web page using the , , or tag.The .svg file is to be referenced in the src attribute of the tag. Let’s see how to add it using the tag.You can try to run the following code to learn how to use .svg files in a web page. We have a smiley.svg file −           HTML SVG               Design          

Should I use , , or for SVG files?
Swarali Sree
Updated on 26-Jun-2020 06:36:09

287 Views

To add SVG files, you can use , or element in HTML. Choose any one of them according to your requirement. Here’s how you can add SVG, elementUse the tag for images without interaction.The disadvantage is you cannot manipulate images with JavaScript. elementThe element is used to define an embedded object within an HTML document. Use it to embed multimedia like audio, video, flash, etc in the web page.    Your browser does not support SVG elementThe tag wasn’t part of the HTML 4 specification and is new in HTML5. It validates in an HTML5 page.

How to add Scalable Vector Graphics (SVG) to your Web Page?

Samual Sam
Updated on 26-Jun-2020 06:30:10

158 Views

SVG stands for Scalable Vector Graphics and is a language for describing 2D-graphics and graphical applications in XML and the XML is then rendered by an SVG viewer. Most of the web browsers can display SVG just like they can display PNG, GIF, and JPG.Note: If you already have an SVG file, then add it using , or tags.To add SVG to web page, use element. Through this, you can easily embed SVG in HTML5 −You can try to run the following code to add scalable vector graphics (SVG) to the web page:       ... Read More

How to preselect Dropdown Using JavaScript Programmatically?

Shubham Vora
Updated on 15-Sep-2022 12:29:01

2K+ Views

In this tutorial, we will learn how to preselect Dropdown using JavaScript Programmatically. A dropdown list is a toggle menu that allows the user to select one of several options. The options in this list are defined here in coding and are linked to a unique function. When you click or choose this option, that function is triggered and begins to work. A dropdown list allows us to select only one item from a list of options. To construct a basic dropdown list in HTML, the tab is combined with the, tab. Following that, JavaScript assists in performing ... Read More

How can I set the default value for an HTML