Rishi Rathor has Published 155 Articles

What is the role of shiftKey Mouse Event in JavaScript?

Rishi Rathor

Rishi Rathor

Updated on 23-May-2020 09:29:49

138 Views

The shiftkey mouse event property is used to show whether SHIFT key is pressed or not when mouse button is clicked.ExampleYou can try to run the following code to learn how to implement shiftKey Mouse event in JavaScript.           Press and hold SHIFT key and then ... Read More

How to use HTML5 Geolocation Latitude/Longitude API?

Rishi Rathor

Rishi Rathor

Updated on 18-May-2020 08:28:23

535 Views

HTML5 Geolocation API lets you share your location with your favorite websites. A JavaScript can capture your latitude and longitude and can be sent to backend web server and do fancy location-aware things like finding local businesses or showing your location on a map.The geolocation APIs work with a new ... Read More

How to use height and width attributes in HTML?

Rishi Rathor

Rishi Rathor

Updated on 14-May-2020 10:18:06

4K+ Views

The height and width attribute in HTML is used to specify the height and width of the element. The values are set in px i.e. pixels.The height and width attribute is used in the following HTML elements:S. NoElementsAttributeAttribute1 elementheightwidth2 elementheightwidth3 elementheightwidth4 elementheightwidth5 elementheightwidth6 elementheightwidth7 elementheightwidthTo add an image in an ... Read More

Set the language of the linked document in HTML

Rishi Rathor

Rishi Rathor

Updated on 03-Mar-2020 12:35:15

79 Views

Use the hreflang attribute to set the language of the linked document in HTML.ExampleYou can try to run the following code to implement the hreflang attribute −           HTML hreflang attribute               Database Tutorial:       DBMS    

Execute a script when an element is being dragged over a valid drop target in HTML?

Rishi Rathor

Rishi Rathor

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

81 Views

When an element is being dragged and dropped in HTML, the ondragover attribute fires.ExampleYou can try to run the following code to implement the ondragover attribute −                    .drag {             float: left;     ... Read More

How to execute the script when the page has finished parsing in HTML?

Rishi Rathor

Rishi Rathor

Updated on 03-Mar-2020 05:29:14

323 Views

Use the defer attribute to execute the script when the page has finished parsing in HTML.Firstly, add a js file.Let us give it a name,  new.js, function sayHello() {    alert("Hello World") }ExampleLet’s add the HTML code now and execute the above script −             ... Read More

How to store a name permanently using HTML5 Local Storage?

Rishi Rathor

Rishi Rathor

Updated on 25-Feb-2020 07:00:54

276 Views

The Local Storage is designed for storage that spans multiple windows and lasts beyond the current session. In particular, Web applications may wish to store megabytes of user data, such as entire user-authored documents or a user's mailbox, on the client side for performance reasons.HTML5 localStorage saves string data in ... Read More

protected access modifier in Java

Rishi Rathor

Rishi Rathor

Updated on 24-Feb-2020 12:32:07

584 Views

Variables, methods, and constructors, which are declared protected in a superclass can be accessed only by the subclasses in other package or any class within the package of the protected members' class.The protected access modifier cannot be applied to class and interfaces. Methods, fields can be declared protected, however methods ... Read More

Why it shows 0 instead of empty string whenever I insert an empty string into a MySQL column which is declared as NOT NULL?

Rishi Rathor

Rishi Rathor

Updated on 14-Feb-2020 06:22:42

916 Views

It is because inserting an empty string means that we are inserting some value and not NULL. The empty string apparently maps to zero as an integer. In other words, we can say that by inserting empty string we are providing a value to MySQL that has integer representation as ... Read More

Can a local variable's memory be accessed outside its scope in C/C++?

Rishi Rathor

Rishi Rathor

Updated on 11-Feb-2020 10:20:27

112 Views

Let us look at an example where you MIGHT be able to access a local variable's memory outside its scope.Example#include int* foo() {    int x = 3;    return &x; } int main() {    int* address = foo();    cout

Previous 1 ... 6 7 8 9 10 ... 16 Next
Advertisements