Usharani has Published 88 Articles

How to call a JavaScript function from an onsubmit event?

usharani

usharani

Updated on 16-Jun-2020 11:37:14

The onsubmit event occurs when you try to submit a form. You can put your form validation against this event type. The following example shows how to use onsubmit. Here, we are calling a validate() function before submitting a form data to the webserver. If validate() function returns true, the ... Read More

What are Java parent and child classes in Java?

usharani

usharani

Updated on 16-Jun-2020 08:47:34

Java supports inheritance, an OOPs concept where one class acquires the members (methods and fields) of another.You can inherit the members of one class from another, use the extends keyword as:class A extends B{}The class which inherits the properties of other is known as child class (derived class, sub class) ... Read More

How to use labels in Java code?

usharani

usharani

Updated on 16-Jun-2020 06:29:04

Java provides two types of branching/control statements namely, break and continue.The break statementThis statement terminates the loop or switch statement and transfers execution to the statement immediately following the loop or switch.ExampleFollowing is the example of the break statement. Here we are trying to print elements up to 10 and, ... Read More

How to programmatically empty browser cache with HTML?

usharani

usharani

Updated on 01-Jun-2020 10:53:08

You can tell your browser not to cache your page by using the following meta tags − In addition, try the following:  Append a parameter/string to the filename in the script tag. Change it when the file changes.Then the next time you update the file, just update the version i.e.Read More

Execute a script when a mouse pointer moves over an element in HTML?

usharani

usharani

Updated on 30-May-2020 23:25:36

The onmouseover attribute triggers when a mouse pointer moves over an element in HTML.ExampleYou can try to run the following code to implement onmouseover attribute −                    This is demo heading.             Keep the mouse cursor on the heading to change the color.                function display() {             document.getElementById("myid").style.color = "red";          }          

How to use multiple click event on HTML5 canvas?

usharani

usharani

Updated on 04-Mar-2020 06:13:50

When there is a circle drawn on canvas and we put red color on half and grey color on a portion of a circle, then on clicking a red color, we call function1.On clicking grey part, function 2 is called and we need to use reusable path objects to store ... Read More

Change text color based on a brightness of the covered background area in HTML?

usharani

usharani

Updated on 04-Mar-2020 05:03:50

It is possible to change the textcolour depending on the average brightness of the covered pixels ofits parent's background color by using the following code snippet.var rgb = [255, 0, 0]; setInterval(display, 1000); function display() {    rgb[0] = Math.round(Math.random() * 255);    rgb[1] = Math.round(Math.random() * 255);    rgb[2] ... Read More

Bootstrap dropdown closing when clicked in HTML

usharani

usharani

Updated on 04-Mar-2020 05:03:11

As you may have seen, whenever you open a dropdown, and click anywhere else, the dropdown close. By using the below given code, the dropdown menu can be kept open after click−$('#myDropdown').on('hide.bs.dropdown', function () {    return false; });Another option is to handle the clickevent −The click event can also be ... Read More

Execute a script when an element's scrollbar is being scrolled in HTML?

usharani

usharani

Updated on 03-Mar-2020 09:36:30

When an element is scrolled, the onscroll attribute triggers. You can try to run the following code to implement onscroll attribute −Example                    #myid {             width   : 250px;             height ... Read More

How to specify citation in HTML?

usharani

usharani

Updated on 03-Mar-2020 06:48:41

Use the tag in HTML to specify citation. Cite can be defined as the title of a work. You can try to run the following code to implement tag for adding citation −Example           HTML cite Tag               The learning content can be referred from Data Structures        & Algorithms in Java    

Previous 1 ... 3 4 5 6 7 ... 9 Next
Advertisements