Front End Technology Articles

Page 543 of 652

Create a button look like a link with Bootstrap

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 12-Jun-2020 5K+ Views

Use the .btn-link class in Bootstrap to create a button look like a link.You can try to run the following code to implement a .btn-link classExampleLive Demo           Bootstrap Example                                 The following are FMCG companies:                ITC Limited          Colgate-Palmolive          Nestle          Britannia Industries Limited          

Read More

Make a group of buttons span the entire width of the screen with Bootstrap

Rishi Rathor
Rishi Rathor
Updated on 12-Jun-2020 928 Views

To make a group of buttons span entire width of the screen, use the .btn-group-justified.You can try to run the following code to implement the .btn-group-justified class −ExampleLive Demo           Bootstrap Example                                 The following are the car brands:                BMW          Audi          Jeep          Datsun          Toyota             The following are FMCG:                ITC Limited          Colgate-Palmolive          Nestle          Britannia Industries Limited          

Read More

What is the difference between break with a label and without a label in JavaScript?

Samual Sam
Samual Sam
Updated on 12-Jun-2020 618 Views

Break without labelThe break statement is used to exit a loop early, breaking out of the enclosing curly braces.  The break statement exits out of a loop. ExampleLet’s see an example of break statement in JavaScript without using label −Live Demo                            var x = 1;          document.write("Entering the loop ");                  while (x < 20) {             if (x == 5){                break; // breaks out ...

Read More

What is a default constructor in JavaScript?

mkotla
mkotla
Updated on 12-Jun-2020 871 Views

If a constructor method is not added, then a default constructor should be used. A default constructor is created when nothing is defined.SyntaxHere’s the syntax −constructor() {}The syntax for derived class −constructor(...args) {    super(...args); }

Read More

How to show for loop using a flowchart in JavaScript?

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 12-Jun-2020 1K+ Views

The “for” loop includes loop initialization where we initialize our counter to a starting value. The initialization statement is executed before the loop begins, the test statement which will test if a given condition is true or not. If the condition is true, then the code given inside the loop will be executed, otherwise, the control will come out of the loop.At the end comes the iteration statement where you can increase or decrease your counter. Let us see how to show for loop using flowchart in JavaScript −

Read More

What is an alert box in JavaScript?

Krantik Chavan
Krantik Chavan
Updated on 12-Jun-2020 1K+ Views

An alert dialog box is mostly used to give a warning message to the users. For example, if one input field requires to enter some text but the user does not provide any input, then as a part of validation, you can use an alert box to give a warning message.Nonetheless, an alert box can still be used for friendlier messages. Alert box gives only one button "OK" to select and proceed.ExampleYou can try to run the following code to learn how to add an alert box −Live Demo                                         Click the following button to see the result:                          

Read More

How to use window.location to redirect to a different URL with JavaScript?

Nishtha Thakur
Nishtha Thakur
Updated on 12-Jun-2020 557 Views

You might have encountered a situation where you clicked a URL to reach a page X but internally you were directed to another page Y. It happens due to page redirection.It is quite simple to do a page redirect using JavaScript on the client side. To redirect your site visitors to a new page, you just need to add a line in your head section as follows −ExampleYou can try to run the following code to learn how to use window.location to redirect to another URL. Here, we will redirect to the home pageLive Demo           ...

Read More

Why doesn&#039;t JavaScript have a goto statement?

Samual Sam
Samual Sam
Updated on 12-Jun-2020 411 Views

JavaScript has a goto statement, which is a reserved keyword. It isn’t popular since it is not needed in JavaScript. Generally, it isn’t considered a good practice to use a goto statement.Using goto with JavaScript preprocessing is still considered good as shown below −var a = 0; [lbl] beginning: console.log("Demo Text!"); a++; if(i < 424) goto beginning;The above code gets translated like the following −var a = 0; beginning: while(true) {    console.log("Demo Text!");    a++;    if(i < 424) continue beginning;    break; }

Read More

How to use labels to control the Flow in JavaScript?

Priya Pallavi
Priya Pallavi
Updated on 12-Jun-2020 494 Views

To control the flow in JavaScript, use labels. A label can be used with break and continue statement to control the flow more precisely. A label is simply an identifier followed by a colon (:) that is applied to a statement or a block of code. We will see two different examples to understand how to use labels with break and continue.ExampleYou can try to run the following code to use labels to control the flow, with break statement −Live Demo                                     ...

Read More

What is the best way to break from nested loops in JavaScript?

Jennifer Nicholas
Jennifer Nicholas
Updated on 12-Jun-2020 1K+ Views

The best way to break from nested loops is to use labels. A label can be used with break and continue to control the flow more precisely. A label is simply an identifier followed by a colon (:) that is applied to a statement or a block of code.ExampleYou can try to run the following code to implement Label with a break statement to break from nested loops −Live Demo                    document.write("Entering the loop! ");          outerloop:  // This is the label name          for (var ...

Read More
Showing 5421–5430 of 6,517 articles
« Prev 1 541 542 543 544 545 652 Next »
Advertisements