Found 8862 Articles for Front End Technology

How to Split large string in to n-size chunks in JavaScript?

Nikhilesh Aleti
Updated on 23-Sep-2022 10:51:32

3K+ Views

A string is an order of one or more characters that contain numbers, letters, symbols, or special characters. In JavaScript strings are immutable. i.e., once you create a string you cannot change its value. For example, consider the following snippet here we have created a string variable and assigned a value (Tutorialspoint) to it. In the next statement, we are trying to change the contents of the string at the first index. Then we are displaying the contents of the string. let x = 'Tutorialspoint'; x[0] = 't'; console.log(x); //Tutorialspoint. On executing this code ... Read More

HTML Computer Code Elements

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

305 Views

To display computer codes on the web page, some elements are provided in HTML. Let us see those elements one by one − element in HTMLThe tag is used to define the keyboard input. Use this when you want the user to type on their keyboard, for example, shortcut keys Ctrl+C for copy, Esc for exit, etc.Let us now see an example to implement the tag −Example Live Demo Shortcut Keys Use the following shortcut keys − Cut − CTRL+X Copy − CTRL+C Paste − CTRL+V Undo − CTRL+Z Output element in HTMLThe tag in ... Read More

HTML cite Attribute

George John
Updated on 30-Jul-2019 22:30:26

132 Views

The cite attribute of the element sets a URL to the HTML document and states why a specific text was deleted. Following is the syntax −Here, url is the link that displays the address of the document wherein it is specified why the text was deleted. Let us now see an example to implement the cite attribute of the element −Example Live Demo Subjects to Learn    JavaScript    A scripting language.    Java    It is a programming language.    jQuery    A JavaScript library.    C#    Object-oriented programming language. Internal Exams from 3rd May ... Read More

HTML cite Attribute

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

136 Views

The cite attribute of the element is used to set a URL that specified the reason to insert the text. Following is the syntax −Above, we have set url, which is the address to the document explaining the reason to insert the text. Let us now see an example to implement the cite attribute of the element −Example Live Demo Demo Heading Text is inserted. OutputIn the above example, we have inserted a text using the element −    Text is inserted. Above, we have set the reason of insertion using the cite attribute −cite="new.htm

HTML hreflang Attribute

Chandu yadav
Updated on 30-Jul-2019 22:30:26

138 Views

The hreflang attribute of the element is used to set the language of the url in the area. Following is the syntax −Above, code is the ISO language code set for the language, for example, en for English, fr for French, js for Japanese, etc. Let us now see an example to implement the hreflang attribute for the element −Example Live Demo Learning Learn these technologies with ease....             OutputIn the above example, we have set the map on the following image −Now, we have set the map and ... Read More

HTML canvas strokeStyle Property

George John
Updated on 30-Jul-2019 22:30:26

315 Views

The strokeStyle property in HTML canvas is used to set the color, gradient or pattern for the stroke. The element allows you to draw graphics on a web page using JavaScript. Every canvas has two elements that describes the height and width of the canvas i.e. height and width respectively.Following is the syntax −context.strokeStyle=color|gradient|pattern;Above, the values, include −color − The stroke color of the drawing.gradient − Linear or radial gradient object to create gradient strokepattern − The pattern object to create pattern stroke.Let us now see an example to implement the strokeStyle property of canvas −Example Live Demo   ... Read More

How to implement insertion sort in JavaScript?

Nikhilesh Aleti
Updated on 23-Sep-2022 10:58:22

1K+ Views

Insertion Sort The Insertion Sort is a sorting algorithm that works very similar to the way we sort the playing cards when we play. The arrangement of elements in a sorted manner. In this algorithm, the array will be divide virtually into two parts which are sorted and unsorted parts. The values present in unsorted part will be pick and placed at the correct position where it satisfies the sorting order. The Insertion sort is simple algorithm having simple implementation. Generally, this algorithm is efficient for smart data values. This is suitable for data sets which are already partly ... Read More

HTML coords Attribute

Arjun Thakur
Updated on 30-Jul-2019 22:30:26

422 Views

The cords attribute of the element is used to set the coordinates of area in image map. Use the attribute with shape attribute and set the size & shape of an area.Following is the syntaxUnder the value above, you can set the following coordinates with different parameters −x1, y1, x2, y2Coordinates of the top-left and bottom-right corner of the rectangle (shape="rect")x, y, radiusCoordinates of the circle center and the radius (shape="circle")x1, y1, x2, y2, .., xn, ynCoordinates of the edges of the polygon.Let us now see an example to implement the cords attribute of the element −Example Live Demo ... Read More

HTML

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

585 Views

The value attribute of the element is used to set the initial value of a button. You can set this in a . Here, we will be showing an example without using a form.Following is the syntax −Above, value is the initial value.Let us now see an example to implement value attribute in −Example Live Demo Click below to get details about the learning content... Get Tutorials Get InterviewQA    function demo1() {       var val1 = document.getElementById("button1").value;       document.getElementById("myid").innerHTML = val1;    }    function demo2() {       ... Read More

HTML datetime Attribute

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

197 Views

The datetime attribute of the element is used to specify the date and time displaying when the text was inserted.Following is the syntax −Above, the attribute datatime displays the datetime when the text was inserted in the following format −YYYY - yearMM - monthDD - day of the monthhh - hourmm - minutesss - secondsTZD - Time Zone DesignatorLet us now see an example to implement the datetime attribute of the element −Example Live Demo    Demo Heading    Text is inserted. OutputIn the above example, we have inserted a text using the element − ... Read More

Advertisements