Found 2202 Articles for HTML

HTML

Anvi Jain
Updated on 30-Jul-2019 22:30:26

720 Views

The value attribute of the element is used to set the initial value of a button. You can set this in a . Here, we will be showing an example without using a form.Following is the syntax −Above, value is the initial value.Let us now see an example to implement value attribute in −Example Live Demo Click below to get details about the learning content... Get Tutorials Get InterviewQA    function demo1() {       var val1 = document.getElementById("button1").value;       document.getElementById("myid").innerHTML = val1;    }    function demo2() {       ... Read More

HTML datetime Attribute

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

271 Views

The datetime attribute of the element is used to specify the date and time displaying when the text was inserted.Following is the syntax −Above, the attribute datatime displays the datetime when the text was inserted in the following format −YYYY - yearMM - monthDD - day of the monthhh - hourmm - minutesss - secondsTZD - Time Zone DesignatorLet us now see an example to implement the datetime attribute of the element −Example Live Demo    Demo Heading    Text is inserted. OutputIn the above example, we have inserted a text using the element − ... Read More

HTML checked Attribute

Smita Kapse
Updated on 10-Jun-2020 07:15:29

290 Views

The checked attribute of the element specifies that the input type checkbox is checked when the web page loads. You can also use this attribute with input type radio.Following is the syntax −Above, we have set it checked since we wanted the checkbox to be selected when the web page loads.Let us now see an example to implement the checked attribute of the element −Example Live Demo Register Id:  Password:  DOB:  Telephone:  Email:  Newsletter Subscription:  Submit OutputIn the above example, we have a form with a button − Id:  Password:  DOB:  Telephone:  Email:  Newsletter ... Read More

HTML Color Styles

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

363 Views

Colors are very important to give a good look and feel to your website.Hex Code (Hexadecimal colors representation)A hexadecimal is a 6 digit representation of a color. The first two digits (RR) represent a red value, the next two are a green value(GG), and the last are the blue value(BB).A hexadecimal value can be taken from any graphics software like Adobe Photoshop. Each hexadecimal code will be preceded by a pound or hash sign #. Following is a list of few colors using hexadecimal notation. Following are some examples of hexadecimal colors −Let us see an example to implement the ... Read More

How to create JLabel to hold multiline of text using HTML in Java?

Samual Sam
Updated on 30-Jul-2019 22:30:26

1K+ Views

To hold multiline of text, set HTML under JLabel −JLabel = new JLabel("" + "Line1Line2",JLabel.LEFT);The above will create multiline text in the JLabel −Line1 Line2The following is an example to create JLabel to hold multiline of text −Exampleimport java.awt.Font; import javax.swing.*; public class SwingDemo {    public static void main(String args[]) {       JFrame frame = new JFrame("Label Example");       JLabel label;       label = new JLabel("" + "Line1       Line2",JLabel.LEFT);       label.setBounds(100, 100, 100, 30);       label.setFont(new Font("Verdana", Font.PLAIN, 13));       frame.add(label);       frame.setSize(500,300);       frame.setLayout(null);       frame.setVisible(true);    } }Output

How to change text font for JLabel with HTML in Java?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

996 Views

To change text font, you can use the setFont() method of JLabel −label.setFont(new Font("Verdana", Font.PLAIN, 12));The following is an example to change text font for JLabel with HTML −Exampleimport java.awt.Font; import javax.swing.*; public class SwingDemo {    public static void main(String args[]) {       JFrame frame = new JFrame("Label Example");       JLabel label;       label = new JLabel("" + "ABC");       label.setBounds(50, 50, 100, 30);       label.setFont(new Font("Verdana", Font.PLAIN, 12));       frame.add(label);       frame.setSize(500,300);       frame.setLayout(null);       frame.setVisible(true);    } }Output

TypedArray.values() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:33:13

83 Views

The values() function of the TypedArray returns an iterator object which holds the values of the typed array. The next() method returns the next element in the iterator object.SyntaxIts Syntax is as followstypedArray.values()Example Live Demo    JavaScript Example           var typedArray = new Int32Array([11, 5, 13, 4, 15, 3, 17, 2, 19, 8 ]);       var iterator = typedArray.values();       document.write("Contents of the typed array: ");       for(i=0; i

TypedArray.sort() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 13:33:45

120 Views

The sort() method of the Typed Array object arranges the elements of the array in ascending order and returns it.SyntaxIts Syntax is as followsarrayBuffer.sort()Example Live Demo    JavaScript Array every Method           var typedArray = new Int32Array([11, 5, 13, 4, 15, 3, 17, 2, 19, 8 ]);       document.write("Contents of the typed array: "+typedArray);       document.write("");       var resultantArray = typedArray.sort();       document.write("Resultant Array: "+resultantArray);     OutputContents of the typed array: 11,5,13,4,15,3,17,2,19,8 Resultant Array: 2,3,4,5,8,11,13,15,17,19

TypedArray.fill() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:09:24

103 Views

The fill() function of the TypedArray object replaces all the required/desired elements of the array with specifies value (fixed). This function accepts three numbers one representing a fixed value and the other two represents the start and end indexes of the portion of the elements to be replaced (end value is optional).SyntaxIts Syntax is as followsint32View.fill(464, 3);Example Live Demo    JavaScript Array every Method           var int32View = new Int32Array([64, 89, 65, 21, 14, 66, 87, 55]);       document.write("Contents of the typed array: "+int32View);       document.write("");       result ... Read More

TypedArray.every() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 13:10:46

63 Views

The every() function of TypedArray accepts a string value representing the name of a function, tests whether all the elements in an array passes the test implemented by the provided function.SyntaxIts Syntax is as followstypedArray.every(function_name)Example Live Demo    JavaScript Array every Method           var int32View = new Int32Array([64, 89, 65, 21, 14, 66, 87, 55 ]);       document.write("Contents of the typed array: "+int32View);       document.write("");       function testResult(element, index, array) {          var ele = element>35          return ele;       ... Read More

Advertisements