HTML DOM Clipboard Event

AmitDiwan
Updated on 07-Aug-2019 13:38:41

434 Views

The HTML DOM Clipboard event is used to provide information regarding modification of the clipboard. The events can be cut, copy and paste. The Clipboard event can be used to make your site more accessible i.e. giving user information on how the clipboard is being modified.PropertiesFollowing is the property for Clipboard event −PropertyDescriptionclipboardDataTo return an object containing the data affected by the clipboard operation(cut, copy or paste).EventsFollowing are the event types belonging to the Clipboard event −EventDescriptiononcopyThis event fires when the content of an element is copied by the user.OncutThis event fires when the user cuts the content of an ... Read More

HTML DOM Caption Object

AmitDiwan
Updated on 07-Aug-2019 12:23:10

171 Views

The HTML DOM Caption object is associated with the HTML element. The element is used for setting caption (title) of the table and should be the first child of the table. You can access caption element using the caption object.PropertiesNote: The below property are not supported in the HTML5.Following is the HTML DOM Caption Object property −PropertyDescriptionAlignTo set or return the caption alignment.SyntaxFollowing is the syntax for −Creating a caption object −var x = document.createElement("CAPTION");ExampleLet us see an example for the HTML DOM Caption object −    table, th, td {       border: ... Read More

Check If String Contains Only Letters in Java

Maruthi Krishna
Updated on 07-Aug-2019 12:13:04

2K+ Views

To verify whether a given String contains only characters −Read the String.Convert all the characters in the given String to lower case using the toLower() method.Convert it into a character array using the toCharArray() method of the String class.Find whether every character in the array is in between a and z, if not, return false.ExampleFollowing Java program accepts a String from the user and displays whether it is valid or not.import java.util.Scanner; public class StringValidation{    public boolean validtaeString(String str) {       str = str.toLowerCase();       char[] charArray = str.toCharArray();       for (int i ... Read More

HTML DOM Cancelable Event Property

AmitDiwan
Updated on 07-Aug-2019 12:11:07

189 Views

The HTML DOM cancelable event property is associated with the HTML events as JavaScript can react to these events. The cancelable event property returns a Boolean true or false indicating whether the event can be cancelled or not.SyntaxFollowing is the syntax for cancelable event property −event.cancelableExampleLet us see an example of cancelable event property − Hover over the button below to find out if onmouseover is cancellable event or not CLICK IT    function cancelFunction(event) {       var x = event.cancelable;       if(x==true)          document.getElementById("Sample").innerHTML = "The onmouseover event ... Read More

Difference Between Enumeration Interface and Enum in Java

Maruthi Krishna
Updated on 07-Aug-2019 12:03:00

2K+ Views

Enum in Java is a datatype which stores a set of constant values. You can use these to store fixed values such as days in a week, months in a year etc.You can define an enum using the keyword enum followed by the name of the enumeration as −enum Days {    SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY }Just like arrays, the elements/constants in an enum are identified using numbers starting from 0 in the above example the days are identified using numbers as shown in the following illustration −Retrieving values from an enumYou can retrieve all the elements ... Read More

HTML DOM Button Type Property

AmitDiwan
Updated on 07-Aug-2019 12:02:28

303 Views

The HTML DOM Button type property is associated with the HTML element. The button element by default has type=”submit” i.e clicking on any button on the form will submit the form. The button type property sets or returns the type of button.SyntaxFollowing is the syntax for −Setting the button type property −buttonObject.type = "submit|button|reset"Here, the submit|button|reset are button type values. Submit is set by default.Submit − Makes the button a submit button.Button − Makes a normal clickable button.Reset − Makes a reset button that resets the form data.ExampleLet us see an example of the HTML DOM button type property − ... Read More

Comparing Strings with Possible Null Values in Java

Maruthi Krishna
Updated on 07-Aug-2019 11:59:25

6K+ Views

Strings in Java represents an array of characters. They are represented by the String class.Using compareTo() methodThe compareTo() method of the String class two Strings (char by char) it also accepts null values. This method returns an integer representing the result, if the value of the obtained integer is −0: Given two Strings are equal or, null.1 or less: The current String preceeds the argument.1 or more: The current String succeeds the argument.Exampleimport java.util.Scanner; public class CompringStrings {    public static void main(String args[]) {       Scanner sc = new Scanner(System.in);       System.out.println("Enter your first string ... Read More

HTML DOM Button Object

AmitDiwan
Updated on 07-Aug-2019 11:57:48

772 Views

The HTML DOM Button object is associated with the element.PropertiesFollowing are the properties for the HTML DOM button object −PropertyDescriptionautofocusTo set or return whether a button is automatically focused or not when the page loads.disabledTo set or return whether a given button is disabled or not.formTo return the reference of the form containing the button.formActionTo set or return the formAction attribute value of a button.formEnctypeTo set or return the formEnctype attribute value of a button.formMethodTo set or return the formMethod attribute value of a button.formNoValidateTo set or return whether the form data should be validated or not on submission.formTargetTo ... Read More

HTML DOM Button Name Property

AmitDiwan
Updated on 07-Aug-2019 11:52:31

289 Views

The HTML DOM Button name property is associated with name attribute of the element. The name property is used to set or return the value of the name attribute of the button. The name attribute is used in forms to select an element using JavaScript.SyntaxFollowing is the syntax for −Setting the name property −buttonObject.name = nameHere, the name property value is used to denote the name of the button.ExampleLet us see an example of the button name property − BUTTON Click the button below and change the above button name. CHANGE    function change() { ... Read More

HTML DOM Button Disabled Property

AmitDiwan
Updated on 07-Aug-2019 11:47:41

1K+ Views

The HTML DOM Button disabled property is associated with disabled attribute of the element .The button disabled property is used to set or return whether a given button is disabled or not. It is used to disable the button so that the user can no longer interact with the specified element. Setting the disabled property will grey the button by default in the web browsers.SyntaxFollowing is the syntax for −Setting the disabled property −buttonObject.disabled = true|falseHere, the true|false specifies if the given input button should be disabled or not.True − The button gets disabled.False − The button won’t get disabled.Let us ... Read More

Advertisements