Javascript Articles - Page 665 of 671

How to do case-sensitive string comparison in JavaScript?

Shubham Vora
Updated on 26-Oct-2022 08:33:18

4K+ Views

This tutorial will guide you to learn case-sensitive string comparison in JavaScript. JavaScript is case-sensitive. Keywords, variables, function names, and any identifiers in JavaScript must be in the required case. For example, for keyword cannot be written as For or FOR. What are strings in JavaScript? A string is a collection of one or more characters, which could be letters, numbers, or symbols. Strings are immutable primitive data types in JavaScript, which implies they can never change. Text can be stored and modified using JavaScript strings. Any number of characters enclosed in quotations is a JavaScript string. How can we ... Read More

Why is JavaScript case sensitive but HTML isn't?

varun
Updated on 12-Sep-2019 08:28:32

531 Views

A script is in plain text and not just markup like HTML, which is case insensitive. In JavaScript, the while keyword should be "while", not "While" or "WHILE". Case sensitivity is important since it is closely related to HTML, but some methods and events are mentioned differently. JavaScrip has a strict syntax to process the client-side-scripts written in JavaScript.Some tags and attributes in HTML have the same name as JavaScript objects and properties. In HTML, the attribute and tag names are case-insensitive. The close association of HTML and JavaScript can lead to confusion, so case sensitivity is more important in ... Read More

Why is case sensitivity so much more important in JavaScript?

Prabhas
Updated on 30-Sep-2019 07:41:32

136 Views

A script is in plain text and not just markup like HTML, which is case insensitive. In JavaScript, the while keyword, should be "while", not "While" or "WHILE". Case sensitivity is important since it is closely related to HTML, but some methods and events are mentioned differently.Some tags and attributes in HTML have the same name as JavaScript objects and properties. In HTML, the attribute and tag names are case-insensitive. The close association of HTML and JavaScript can lead to confusion, so case sensitivity is more important in JavaScript. For example, HTML onclick event attribute is mentioned as onClick in ... Read More

What is the difference between HTML tags <div> and <span>?

Bhanu Priya
Updated on 04-Oct-2023 16:21:13

3K+ Views

We can use both DIV and SPAN tags as a Container, as they both have their own specialty. Both are HTML5 tags. First let us discuss about DIV Tag in detail with examples. DIV TAG DIV helps in separating the data like text, images, navigation bar etc., we can also create particular sections by using the DIV tag, it consists of open and close tags , both open and close tags are compulsory if we want to divide the page. DIV tags can be styled with CSS or manipulated with JavaScript, it is easily styled by using the class ... Read More

What is the difference between “lang” and “type” attributes in a script tag?

Arushi
Updated on 12-Sep-2019 08:31:25

291 Views

JavaScript lang attributeThis attribute specifies what scripting language you are using. Typically, its value will be javascript. Although recent versions of HTML (and XHTML, its successor) have phased out the use of this attribute.JavaScript type attributeThis attribute is what is now recommended to indicate the scripting language in use and its value should be set to "text/javascript".Here you can see how it is used:Live Demo                              

What does language attribute do in

What is the difference between comments /*...*/ and /**...*/ in JavaScript?

radhakrishna
Updated on 12-Sep-2019 08:35:18

639 Views

/*…*/ and /**…*/ are multi-line comments. The following is a multi line comment in JavaScript./*    * This is a multiline comment in JavaScript    * It is very similar to comments in C Programming */The following example shows how to use multi-line comments in JavaScript.     The comment /** */ is for  PHPDocumentator ,  which is used to make automatic documentation.

How to Line Breaks to JavaScript Alert?

mkotla
Updated on 30-Jul-2019 22:30:21

5K+ Views

To add line breaks to JavaScript alert, use “\r”. In the following example, we will see how to display text in JavaScript alert.Example Live Demo                    function DisplayAlert() {             var newLine = "\r"             var msg = "Showing how to add line break."             msg += newLine;             msg += "Line Break can be easily added in JavaScript.";             msg += newLine;             msg += "Simply Easy Learning";             msg+= newLine;             msg += "TutorialsPoint.com";             alert(msg); }

How to create a line break with JavaScript?

Giri Raju
Updated on 07-Aug-2024 16:00:27

42K+ Views

To create a line break with JavaScript, we will be understanding three different approaches. In this article, we are having some text content and our task is to create line break using Javascript. We will be using tag, \n and insertAdjacentHTML() method along with block elements with explaination and example codes for each. Approaches to Create a Line Break with JavaScript Line Break Using br tag Line Break new line Character Line Break Using insertAdjacentHTML() Method Line Break Using br tag In this approach to ... Read More

What is the difference between JavaScript and C++?

Alshifa Hasnain
Updated on 17-Feb-2025 18:23:15

3K+ Views

In this article, we will learn the difference between JavaScript and C++. JavaScript and C++ are two widely used programming languages, each designed for different purposes and environments. While JavaScript is primarily used for web development, C++ is known for its high-performance applications, including game development and system programming. The following are the differences between JavaScript and C++ JavaScript is a lightweight, interpreted programming language. It is designed for creating network-centric applications. It is complementary to and integrated with Java. JavaScript is very easy to implement because it is integrated with HTML. It is open and cross-platform. C++ is a ... Read More

Advertisements