Tutorialspoint

What is onmousedown event in JavaScript?

What is an onmousedown event in JavaScript and what is its role? How can I work with an onmousedown event in JavaScript?
varma
Answered on 16th Feb, 2018

The onmousedown event triggers when a mouse button is pressed. You can try to run the following code to learn how to work with onmousedown event in JavaScript:<html>    <head>       <script>          <!--             function sayHello() {     ... Read More

What is oncontextmenu event in JavaScript?

What is oncontextmenu event in JavaScript and what is its role? How can I work with oncontextmenu event in JavaScript?
usharani
Answered on 16th Feb, 2018

On right click of an element, when the context menu opens, then it is known as oncontextmenu in JavaScript.You can try to run the following code to learn how to work with oncontextmenu event in JavaScript:<html>    <head>       <script>          <!--       ... Read More

How to add hours and minutes to a date with JavaScript?

With JavaScript, how can I add hours and minutes to a date? I am displaying the current date like this: , Which JavaScript method should I use to add hours and minutes?
Anvi Jain
Answered on 16th Feb, 2018

To add hours and minutes to a date, use the setHours() and setMinutes() method in JavaScript.You can try to run the following code to add hours and minutes:<html>    <head>       <title>JavaScript Dates</title>    </head>    <body>       <script>          var dt = ... Read More

How to submit an HTML form using JavaScript?

With JavaScript, how can I submit an HTML form? Before submission, I also want to validate the form for fields name, email, zip code, etc.?
varun
Answered on 16th Feb, 2018

To submit an HTML form using JavaScript, we are calling validate() to validate data when the onsubmit event is occurring. You can try to run the following code to submit an HTML form:<html>    <head>       <title>Form Validation</title>       <script>          // Form ... Read More

What are rvalues, lvalues, xvalues, glvalues, and prvalues in C++?

What are rvalues, lvalues, xvalues, glvalues, and prvalues in C++ languages? Can anyone explain this concept clearly?
Samual Sam
Answered on 16th Feb, 2018

An lvalue has an address that your program can access. Examples of lvalue expressions include variable names, including const variables, array elements, function calls that return an lvalue reference, bit-fields, unions, and class members. A xvalue expression has no address but can be used to initialize an rvalue reference, which provides ... Read More

What are Lvalues and Rvalues in C++?

What are Lvalues and Rvalues in C++? Can anyone explain it with an example?
Jai Janardhan
Answered on 16th Feb, 2018

An lvalue (locator value) represents an object that occupies some identifiable location in memory (i.e. has an address).rvalues are defined by exclusion. Every expression is either an lvalue or an rvalue, so, an rvalue is an expression that does not represent an object occupying some identifiable location in memory.For example, ... Read More

How to convert seconds to HH-MM-SS with JavaScript?

With JavaScript, how can I convert seconds to HH-MM-SS? Which methods should I use in JavaScript to achieve this?
Jennifer Nicholas
Answered on 16th Feb, 2018

To convert seconds to HH-MM-SS with JavaScript, try to run the following code:<html>    <head>       <title>JavaScript Dates</title>    </head>    <body>       <div id = "newSeconds"></div>       <script>          var convertSeconds = function(sec) {             ... Read More

What is the type of string literals in C and C++?

What is the type of string literals in C and C++ languages? Can anyone explain the concept clearly?
Lakshmi Srinivas
Answered on 16th Feb, 2018

In C the type of a string literal is a char[]. In C++, an ordinary string literal has type 'array of n const char'. For example, The type of the string literal "Hello" is "array of 6 const char". It can, however, be converted to a const char* by array-to-pointer ... Read More

Difference between C++ string constants and character constants

Difference between C++ string constants and character constants? Can anyone explain this briefly?
karthikeya Boyini
Answered on 16th Feb, 2018

In C++, a character in single quotes is a character literal. It's of type char. For example, 'a' is of type char with a value 97 on an ASCII based system.A character or a string of characters together in double quotes represent a string literal. It's of type const char[] ... Read More

How can we debug JavaScript in Internet Explorer?

 What is the easiest way to get errors in a browser? I want to learn how can I debug my JavaScript script using Internet Explorer web browser. What are the steps to be followed?
Srinivas Gorla
Answered on 16th Feb, 2018

The most basic way to track down errors is by turning on error information in your browser. By default, Internet Explorer shows an error icon in the status bar when an error occurs on the page. Double-clicking this icon takes you to a dialog box showing information about the specific error ... Read More

What are Enumerated Constants in C++?

What are Enumerated Constants in C++ language? Please explain this with an example?
Rishi Raj
Answered on 16th Feb, 2018

An enumerated type declares an optional type name and a set of zero or more identifiers that can be used as values of the type. Each enumerator is a constant whose type is the enumeration. These are also called as enumerated constants.For example, if you are creating an application that ... Read More

How can we debug JavaScript using Firefox?

What is the actual usage of a debugger? I want to learn how to debug my JavaScript script using Firefox web browser. What are the steps to be followed?
Nitya Raut
Answered on 16th Feb, 2018

The process of finding and fixing bugs is called debugging and is a normal part of the development process. Other browsers like Firefox, Netscape, and Mozilla send error messages to a special window called the JavaScript Console or Error Console.Unfortunately, since these browsers give no visual indication when an error ... Read More

How to create Variables and Constants in C++?

How to create Variables and Constants in C++? Can anyone explain regarding this in detail?
Vikyath Ram
Answered on 16th Feb, 2018

To define a variable in  C++, you need to use the following syntax:datatype variable_name;You need to know what type of data is your variable is going to hold and what it will be called. The variable name has constraints on what you can name it. Following are the rules for ... Read More

How can we debug JavaScript using Google Chrome?

What is the actual usage of a debugger? I want to learn how can I debug my JavaScript script using Google Chrome web browser. What are the steps to be followed? 
Abhinanda Shri
Answered on 16th Feb, 2018

The process of finding and fixing bugs is called debugging and is a normal part of the development process.To debug JavaScript using Google Chrome, follow the below-given procedure:Open the Google Chrome web browser. From the right, select Tools,   2.  Go to Tools, and select Developer tools, as shown above.  ... Read More

How to do basic form validation using JavaScript?

With JavaScript, how can I easily validate a form? I want to validate whether the fields are added before submitting or not. Which methods or properties should I use to validate the following: ,
Vrundesha Joshi
Answered on 16th Feb, 2018

JavaScript provides a way to validate form's data on the client's computer before sending it to the web server. Basic form validation includes the form to be checked to make sure all the mandatory fields are filled in. It would require just a loop through each field in the form and ... Read More

Advertisements
Loading...
Unanswered Questions View All