Found 10711 Articles for Web Development

How to create a dialog with “yes” and “no” options in JavaScript?

Anvi Jain
Updated on 30-Jul-2019 22:30:21

3K+ Views

No, you cannot create a dialog box with “yes” or “no”. A confirmation dialog box in JavaScript has “Ok” and “Cancel” button.To create a dialog with “yes” or “nor”, use a custom dialog box.ExampleLive Demo                          function functionConfirm(msg, myYes, myNo) {             var confirmBox = $("#confirm");             confirmBox.find(".message").text(msg);             confirmBox.find(".yes, .no").unbind().click(function() {                confirmBox.hide();             });         ... Read More

How to make page links in HTML Page?

Lokesh Badavath
Updated on 01-Sep-2023 02:14:02

81K+ Views

A link is a connection from one Web page to another web page. We can add page links to a web page. HTML links are hyperlinks. The tag defines a hyperlink and is used to link from one page to another. The href attribute is used with the tag, which indicates the link's destination. To create page links in an HTML page, we need to use the href attribute of the and tag. Make sure that the tag is placed with in the … tags. The link text is visible. Clicking on the link text will ... Read More

How to change button label in alert box using JavaScript?

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

4K+ Views

In this tutorial, we will learn to change the button label in the alert box using JavaScript. The alert box is one kind of popup box that is useful to show some important information to the user. We can pop up the alert box using JavaScript's alert() method. The default alert box contains the simple message and ok button, which pops out at the top center of the browser's screen. The default alert box with only messages and without any style looks weird. So, we need to make it stylish and change the style of the button and the label ... Read More

How to create headings in HTML page?

Lokesh Badavath
Updated on 11-Nov-2022 07:43:28

5K+ Views

Headings are the titles or the subtitles of the content that you want to display on the web page. Headings help us to get an idea on the content on the web page. Headings and subheadings represent the key concepts ideas and supporting ideas in the content of the web page. HTML have different level of heading tags. Heading is defined with to tags. It is important to use headings to show the HTML document structure. headings should be used for main headings, followed by headings, then , and so on up to . Syntax Following ... Read More

How to call a JavaScript function from C++?

vanithasree
Updated on 10-Feb-2020 10:44:18

799 Views

To call a JavaScript function from C++, generate a js file, which calls the function. The web page will load the JS and the function runs −int callId = 0; void callFunction() {    // the js file    ofstream fout("generate.js");    fout

How to create an HTML Document?

Lokesh Badavath
Updated on 11-Nov-2022 07:38:08

18K+ Views

HTML stands for Hyper Text Markup Language. It is the most widely used language to write web page. HTML document defines the structure of web page. HTML document begins with the declaration, and the HTML documents start and end with the and tags. HTML document is split into two parts − Head Body The head which contains the information about the document title etc. The information inside this tag does not display outside (on web page). The information of the head part is placed between … tags. Example Following is the example program for the ... Read More

Why should we use a semicolon after every function in JavaScript?

radhakrishna
Updated on 16-Jun-2020 11:41:07

687 Views

Adding semicolons after every function is optional. To avoid undesirable results, while using functions expressions, use a semicolon.Using semicolonvar display = function () {   alert(“Hello World”); }; (function () {   // code })();Without using semicolonvar display = function () {   alert(“Hello World”); } (function () {   // code })();The first function executes immediately since we have used the semicolon.

How to trigger event in JavaScript?

Vikal Singh
Updated on 03-Oct-2019 06:38:20

674 Views

The trigger() method triggers the specified event and the default behaviour of an event (like form submission) for the selected elements.For example: $( "#foo" ).on( "click", function() {   alert( $( this ).text() ); }); $( "#foo" ).trigger( "click" );

How to write a global error handler in JavaScript?

mkotla
Updated on 16-Jun-2020 11:40:30

2K+ Views

The following global error handler will show how to catch unhandled exception −Example                    window.onerror = function(errMsg, url, line, column, error) {             var result = !column ? '' : 'column: ' + column;             result += !error;             document.write("Error= " + errMsg + "url= " + url + "line= " + line + result);             var suppressErrorAlert = true;             return suppressErrorAlert;          };          setTimeout(function() {             eval("{");          }, 500)          

How to center a popup window on screen using JavaScript?

Shubham Vora
Updated on 02-Aug-2022 10:01:33

9K+ Views

In this tutorial, we will learn to center a popup window on the screen using JavaScript. Programmers often need to open a new popup window to show another webpage without redirecting the user to the other webpage. In this situation, developers use the window.open() method to open the new browser window. Also, we can style the popup window and set the height and width. Also, we can change the position of the popup window to look it better. Sample Popup Window In this section, we will create a sample popup window to get familiar with the how window.open() method works. ... Read More

Advertisements