HTML Articles

Page 135 of 151

Is it a good practice to place all declarations at the top in JavaScript?

Ayyan
Ayyan
Updated on 20-May-2020 156 Views

Yes, it is a good practice to place all the JavaScript declarations at the top. Let’s see an example −Example           JavaScript String match() Method                        // all the variables declared at top          var str, re, found;                    str = "For more information, see Chapter 3.4.5.1";          re = /(chapter \d+(\.\d)*)/i;          found = str.match( re );          document.write(found );           The following are the valid reasons −Gives a single place to check for all the variables.Helps in avoiding global variablesRe-declarations are avoided.The code is easy to read for others as well.

Read More

What will happen if a semicolon is misplaced in JavaScript?

Srinivas Gorla
Srinivas Gorla
Updated on 20-May-2020 251 Views

If a semicolon is misplaced in JavaScript, then it may lead to misleading results. Let’s see an example, wherein the if statement condition is false, but due to misplaced semi-colon, the value gets printed.Example                    var val1 = 10;          if (val1 == 15) {             document.write("Prints due to misplaced semi-colon: "+val1);          }          var val2 = 10;          if (val2 == 15) {             // this won't get printed             document.write(val2);          }          

Read More

How to use the formmethod attribute in HTML?

Nancy Den
Nancy Den
Updated on 14-May-2020 221 Views

The formmethod attribute is used to define the HTTP technique for sending form information. This method is usedwith input type submit a picture. It overrides the method attribute of HTML forms.ExampleYou can try to run the following code to learn how to use the formmethod attribute in HTML.           HTML formmethod attribute                        Student Name          Student Subject                              

Read More

Why do we use the novalidate attribute in HTML?

Arushi
Arushi
Updated on 14-May-2020 6K+ Views

The novalidate attribute in HTML is used to signify that the form won’t get validated on submit. It is a Boolean attribute and useful if you want the user to save the progress of form filing. If the form validation is disabled, the user can easily save the form and continue & submit the form later. While continuing, the user does not have to first validate all the entries.ExampleYou can try to run the following code to learn how to use novalidate attribute in HTML. In the following example, if you will add text in the  field, then it won’t show ...

Read More

Which is the best tutorial site to learn HTML?

Nikitha N
Nikitha N
Updated on 08-May-2020 216 Views

HTML stands for Hyper Text Markup Language, which is the most widely used language on Web to develop web pages. HTML was created by Berners-Lee in late 1991 but "HTML 2.0" was the first standard HTML specification which was published in 1995. HTML 4.01 was a major version of HTML and it was published in late 1999. However, HTML 4.01 version is widely used but currently we are having HTML-5 version, which is an extension to HTML 4.01, and this version published in 2012.To learn HTML, refer HTML tutorial. It explains the below given HTML concepts perfectly:HTML Basic TagsElementsAttributesHTML Phrase ...

Read More

Parse HTML with PHP's HTML DOMDocument

AmitDiwan
AmitDiwan
Updated on 07-Apr-2020 559 Views

The text inside a tag inside class="text" inside with class="main" can be obtained with the following code −Example$html = nodeValue)); }OutputThis will produce the following output −string ‘This is text 1’ (length=14) string ‘This is text 2' (length=14)

Read More

How to use a novalidate attribute in HTML?

Abhinanda Shri
Abhinanda Shri
Updated on 12-Mar-2020 436 Views

The novalidate attribute in HTML is used to signify that the form won't get validated on submit. It is a Boolean attribute. You can try to run the following code to learn how to use novalidate attribute in HTML. In the following example, if you will add text in the field, then it won't show an error. Example           HTML novalidate attribute                         Student Name          Rank                     

Read More

HTML5 Canvas layer disappears on mouse click in Fabric.js and Firefox stops responding when creating a canvas for the image?

karthikeya Boyini
karthikeya Boyini
Updated on 04-Mar-2020 525 Views

If the HTML5 Canvas layer disappears on mouse click in Fabric.js and Firefox stops responding when creating a canvas to the image, then there is a way to drag and drop images from your computer to canvas using Fabric.This can be done by making image draggable property to true by this way −

Read More

Phonegap + Windows Phone 8 : HTML5 viewport meta & scaling issue

karthikeya Boyini
karthikeya Boyini
Updated on 04-Mar-2020 155 Views

Whenever you face such issue, it would mean you have not written the CSS properly.Just add the following in CSS −* {    zoom:1;    -ms-content-zooming:none; }For some code, even the following works −@viewport {    width:320px; } @-ms-viewport {    width:320px;    zoom-user:fixed;    max-zoom:1;    min-zoom:1; }

Read More

Prevent iPhone from zooming in web-app with HTML \\n

Samual Sam
Samual Sam
Updated on 04-Mar-2020 9K+ Views

Giving a meta tag attribute "user-scalable=no" will restrict the user from zooming elsewhere.  Prevent zooming all together by adding this meta tag to your head tag. This tells the mobile browser to use the same width scale and will not allow the user to zoom in at all, hence also disables that annoying behavior. However, some might argue that this is not a very user-friendly way to handle the problem.The element, used along with one or more elements, creates a drop-down list of options for a web form. The element creates the list and each element is ...

Read More
Showing 1341–1350 of 1,508 articles
« Prev 1 133 134 135 136 137 151 Next »
Advertisements