Change Alert Message Text Color Using JavaScript

Nitya Raut
Updated on 16-Jun-2020 13:24:05

2K+ Views

You can try to run the following code to change the alert message text color. To change the text color of the alert message, use the following custom alert box. We’re using JavaScript library, jQuery to achieve this and will change the alert message text color to “#FCD116” −ExampleLive Demo                                function functionAlert(msg, myYes) {             var confirmBox = $("#confirm");             confirmBox.find(".message").text(msg);             confirmBox.find(".yes").unbind().click(function() {     ... Read More

Eulerian Path and Circuit

Samual Sam
Updated on 16-Jun-2020 13:20:51

9K+ Views

The Euler path is a path, by which we can visit every edge exactly once. We can use the same vertices for multiple times. The Euler Circuit is a special type of Euler path. When the starting vertex of the Euler path is also connected with the ending vertex of that path, then it is called the Euler Circuit.To detect the path and circuit, we have to follow these conditions −The graph must be connected.When exactly two vertices have odd degree, it is a Euler Path.Now when no vertices of an undirected graph have odd degree, then it is a ... Read More

Create and Apply CSS to JavaScript Alert Box

Arpit Anand
Updated on 16-Jun-2020 13:17:23

8K+ Views

 The standard alert box in JavaScript does not provide the option to apply CSS. To style your alert box, you need to create a custom one first. The custom alert box will be created using jQuery and styles will be applied to CSS.ExampleYou can try to run the following code to learn how to create and apply CSS to alert box −Live Demo                          function functionAlert(msg, myYes) {             var confirmBox = $("#confirm");             confirmBox.find(".message").text(msg);   ... Read More

Why Does Void in JavaScript Require an Argument

mkotla
Updated on 16-Jun-2020 13:16:19

195 Views

The void operator is used to evaluate the given expression. After that, it returns undefined. It obtains the undefined primitive value, using void(0) i.e. 0 as an argument.The void(0) can be used with hyperlinks to obtain the undefined primitive value, ExampleLive Demo           Understanding JavaScript void(0)               Click me not once, but twice.     We used JavaScript:void(0) above to prevent the page from reloading when the button is clicked the first time.The code will only work when the button will be clicked twice. If it is clicked once, ... Read More

Create HTML Link That Doesn't Follow the Link

Sreemaha
Updated on 16-Jun-2020 13:15:46

429 Views

Use “nofollow” to create HTML link that doesn’t follow the link. In HTML, while adding an external link, you can set the attribute “rel” as “nofollow” or “dofollow” −The “nofollow” value tells the search engine − “Don't follow links on this page" or "Don't follow this specific link."Another WebsiteWhile using “nofollow”, the search engine won’t transfer anchor text across these link.

Show Image in Alert Box Using JavaScript

Nancy Den
Updated on 16-Jun-2020 13:14:55

2K+ Views

To show an image in alert box, try to run the following code. Here, an alert image is added to the custom alert box −ExampleLive Demo                                function functionAlert(msg, myYes) {             var confirmBox = $("#confirm");             confirmBox.find(".message").text(msg);             confirmBox.find(".yes").unbind().click(function() {                confirmBox.hide();             });             confirmBox.find(".yes").click(myYes);         ... Read More

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);          }                        

Difference Between void eval and Function Constructor in JavaScript

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

370 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

Make an Anchor Tag Refer to Nothing

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

5K+ 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!      

Replace JavaScript Alert Pop-Up with a Fancy Alert Box

Daniol Thomas
Updated on 16-Jun-2020 13:10:14

1K+ Views

To design a custom JavaScript alert box, try to run the following code. The code uses a JavaScript library jQuery and CSS to create a fancy alert box different from the standard JavaScript alert box −ExampleLive Demo                                function functionAlert(msg, myYes) {             var confirmBox = $("#confirm");             confirmBox.find(".message").text(msg);             confirmBox.find(".yes").unbind().click(function() {                confirmBox.hide();             }); ... Read More

Advertisements