Sreemaha has Published 87 Answers

Execute a script when the media is ready to start playing in HTML?

Sreemaha

Sreemaha

Updated on 30-May-2020 22:50:00

Use the oncanplay attribute to define when an audio/ video is ready to start playing.ExampleYou can try to run the following code to learn how to execute a script when the media is ready to start playing −<!DOCTYPE html> <html>    <body>       <video id = "myid" width = ... Read More

How to add a paragraph in HTML?

Sreemaha

Sreemaha

Updated on 27-May-2020 21:46:11

Use the HTML <p> tag to add a paragraph in HTML. You can try to run the following code to implement <p> tag in HTML −Example<!DOCTYPE html> <html>    <head>       <title>HTML p Tag</title>    </head>    <body>       <p>This is demo text.</p>    </body> </html>Read More

HTML 5 local Storage size limit for sub domains

Sreemaha

Sreemaha

Updated on 04-Mar-2020 04:57:24

HTML5's localStorage databases are size-limited. The standard sizes are 5 or 10 MB per domain. A limit of 5 MB per origin is recommended.The following is stated −User agents should guard against sites storing data under their origin's other affiliated sites, e.g. storing up to the limit in a1.example.com, a2.example.com, ... Read More

How to specify that the details should be visible to the user in HTML?

Sreemaha

Sreemaha

Updated on 03-Mar-2020 10:30:23

Use the open attribute to specify that the details should be visible to the user. You can try to run the following code to implement novalidate attribute −Example<!DOCTYPE html> <html>    <head>       <title>HTML open attribute</title>    </head>    <body>       <details open>          <summary>Some ... Read More

How to set the audio output of the video to mute in HTML?

Sreemaha

Sreemaha

Updated on 03-Mar-2020 10:27:59

Use the muted attribute to set the audio output of the video to mute. You can try to run the following code to implement muted attribute −Example<!DOCTYPE HTML> <html>    <body>       <video width = "300" height = "200" controls muted>          <source src = "/html5/foo.ogg" type ... Read More

How to specify the URL of the resource to be used by the object in HTML?

Sreemaha

Sreemaha

Updated on 03-Mar-2020 09:40:41

Use the data attribute in HTML to specify the URL of the resource to be used by the object in HTML.ExampleYou can try to run the following code to implement the data attribute −<!DOCTYPE html> <html>    <body>       <h2>Demonstration</h2>       <object width = "250" height = "300" ... Read More

How do we add a table row in HTML?

Sreemaha

Sreemaha

Updated on 02-Mar-2020 12:29:39

Use the <tr> tag to add a table row. The HTML <tr> tag is used for specifying a table row within a table.The HTML <tr> tag also supports the following additional attributes −AttributeValueDescriptionAlignrightleftcenterjustifycharDeprecated − Visual alignment.bgcolorrgb(x, x, x)#hexcodecolornameDeprecated − Specifies the background color of the table cell.CharCharacterDeprecated − Specifies which character to align ... Read More

How to remove an element from an array in Java

Sreemaha

Sreemaha

Updated on 24-Feb-2020 11:11:49

Following example shows how to remove an element from array. Exampleimport java.util.ArrayList; public class Main {    public static void main(String[] args) {       ArrayList objArray = new ArrayList();       objArray.clear();       objArray.add(0, "0th element");       objArray.add(1, "1st element");       objArray.add(2, ... Read More

Why is char[] preferred over String for storing passwords?

Sreemaha

Sreemaha

Updated on 24-Feb-2020 10:31:39

Yes, Storing password in String object is not safe for following reasons −String objects are immutable and until garbage collected, they remain in memory.String being plain text can be tracked in memory dump of the application.In log, String based password may be printed which can cause a problem.Char[] can be ... Read More

The most elegant ways to iterate the words of a java string.

Sreemaha

Sreemaha

Updated on 24-Feb-2020 10:25:38

Just split the string based on space and then iterate it. See the example below −Examplepublic class Tester {    public static void main(String[] args) {       String test = "I love learning Java";       String[] subStrings = test.split(" ");       for(String subString: subStrings) ... Read More

Advertisements