Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Front End Technology Articles
Page 543 of 652
Create a button look like a link with Bootstrap
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 MoreMake a group of buttons span the entire width of the screen with Bootstrap
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 MoreWhat is the difference between break with a label and without a label in JavaScript?
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 MoreWhat is a default constructor in JavaScript?
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 MoreHow to show for loop using a flowchart in JavaScript?
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 MoreWhat is an alert box in JavaScript?
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 MoreHow to use window.location to redirect to a different URL with JavaScript?
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 MoreWhy doesn't JavaScript have a goto statement?
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 MoreHow to use labels to control the Flow in JavaScript?
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 MoreWhat is the best way to break from nested loops in JavaScript?
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