Found 10711 Articles for Web Development

How to set text direction in HTML?

Lokesh Badavath
Updated on 11-Nov-2022 10:34:27

2K+ Views

The direction property specifies the text direction within a block element on the web page. We use the style attribute, to set text direction in HTML. The style attribute specifies an inline style for an element within a block. The style attribute is used with the CSS property direction to set direction for the text. Syntax Following is the syntax to set text direction using CSS property. Below syntax set the text to right-to-left direction. The text… Example Following is the example program to set text direction in HTML. DOCTYPE html> ... Read More

How to mark work title using cite tag in HTML?

Lokesh Badavath
Updated on 11-Nov-2022 10:26:24

99 Views

Work title can be the title for a book, a song, a painting, a movie, etc. We use tag, to mark work title in HTML. The tag indicates citation and whatever comes inside the tag represents work title for specified thing on we page. Syntax Following is the syntax for the tag. Work title Example Following is example program for the tag. DOCTYPE html> HTML cite tag Heading Learn Java from Java ... Read More

How to mark abbreviation or acronyms in HTML?

Lokesh Badavath
Updated on 11-Nov-2022 09:21:52

253 Views

We use shortened versions to represent a series of letters. The HTML tag, used to define an abbreviation or an acronym, like "HTML", "CSS", "Mr.", etc. Syntax Following is the syntax for the tag. DLF Example Following is the example program for the tag. DOCTYPE html> HTML abbr tag Timings We follow AI for our webinars. Example Following is one more example program for the tag. DOCTYPE ... Read More

How to display JavaScript variable value in alert box?

varma
Updated on 16-Jun-2020 13:14:18

8K+ Views

To display JavaScript variable value in an alert box, try to run the following code −ExampleLive Demo                    function display() {             var a = "Simple";             var b = "Learning";             alert(a +" Easy "+ b);          }                        

What is the difference between void, eval, and the Function constructor in JavaScript?

usharani
Updated on 16-Jun-2020 13:12:48

209 Views

The void keywordThe void is an important keyword in JavaScript, which can be used as a unary operator that appears before its single operand, which may be of any type. This operator specifies an expression to be evaluated without returning a value.The syntax of the void can be either of the following two −               The eval() functionThe JavaScript eval() is used to execute an argument. The code gets execute slower when the eval() method is used. It also has security implementations since it has a different scope of execution.ExampleHere’s how you can ... Read More

How to make an anchor tag refer to nothing?

varun
Updated on 16-Jun-2020 13:10:42

4K+ Views

To make an anchor tag refer to nothing, use “javascript: void(0)”. The following link does nothing because the expression "0" has no effect in JavaScript. Here the expression "0" is evaluated, but it is not loaded back into the current document.ExampleLive Demo                                         Click the following, This won't react at all...       Click me!      

What is the difference between JavaScript undefined and void(0)?

Prabhas
Updated on 16-Jun-2020 13:09:36

372 Views

JavaScript undefinedIt means a variable declared, but no value has been assigned a value.For example, var demo; alert(demo); //shows undefined  alert(type of demo); //shows undefinedHere’s another example showing the usage of undefined to check whether a variable exists or not:ExampleLive Demo                    var age = 10;          if( typeof age !== 'undefined' ) {             document.write("True");          } else{             document.write("False");          }           OutputTrueJavaScript void(0)The void ... Read More

How to use void keyword in JavaScript?

Shubham Vora
Updated on 31-Oct-2022 11:01:31

182 Views

In this tutorial, let us discuss how to use the void keyword in JavaScript. We use the void keyword as the return type of function that does not return any value. It evaluates an expression and returns undefined. We can use this with a single operand because this is a unary operator. We should not wrap the expression in parentheses because void is not a function. void 0 is the same as void(0). Users can follow the syntax blocks to deal with each use case. Syntax void expression The expression can be a variable or a function. Use void ... Read More

How to call JavaScript function in an alert box?

Saurabh Jaiswal
Updated on 05-Apr-2023 10:59:07

5K+ Views

To call a JavaScript function in an alert box, you can use the alert() function, a built-in function in JavaScript that displays an alert dialog with a specified message. An alert box is a simple dialog box that displays a message to the user and provides an OK button. It is a built-in function in JavaScript that is often used for debugging or displaying simple notifications to the user. Here's an example of how to use the alert() function in JavaScript − alert("Hello, World!"); // displays an alert box with the message "Hello, World!" The alert() function takes a ... Read More

How to center the JavaScript alert message box?

Shubham Vora
Updated on 02-Aug-2022 13:46:53

9K+ Views

In this tutorial, we will learn to center the JavaScript alert box. In JavaScript, an alert box is useful to show users some message, information, warning, success, etc. Let’s understand it by real-world example when you open any website on the web browser and start to authenticate by entering your username and password. When you click the submit button, it gives a message in an alert box like the password should of be 8 or more characters, or sign in successfully. Users can create the alert box using JavaScript's alert() method. Unfortunately, the default alert box doesn’t allow us to ... Read More

Advertisements