Ramu Prasad has Published 79 Articles

How to redirect to another webpage using JavaScript?

Ramu Prasad

Ramu Prasad

Updated on 20-Apr-2022 12:40:56

The window.location object contains the current location or URL information. We can redirect the users to another webpage using the properties of this object. window.location can be written without the prefix window.We use the following properties of the window.location object to redirect the users to another webpage −window.location.href- it returns ... Read More

How to make graphics with a script in HTML?

Ramu Prasad

Ramu Prasad

Updated on 24-Jun-2020 08:51:09

To make graphics with a script, use the tag. The HTML tag is for drawing graphics, animations, etc using scripting.The following are the attributes of the tag −AttributeValueDescriptionheight pixelsSpecifies the height of the canvas.width pixelsSpecifies the width of the canvas.ExampleYou can try to run the following code ... Read More

How to include a title in a fieldset in HTML?

Ramu Prasad

Ramu Prasad

Updated on 24-Jun-2020 07:43:37

Use the tag to include a title. The HTML tag s used to define a title for tag. It supports the following attribute −AttributeValueDescriptionAligntopbottomleftrightDeprecated − Specifies the content alignment.ExampleYou can try to run the following code to implement tag in HTML −       ... Read More

How to fix Array indexOf() in JavaScript for Internet Explorer browsers?

Ramu Prasad

Ramu Prasad

Updated on 24-Jun-2020 06:37:02

To fix Array.indexOf() for Internet Explorer web browser, use the following −jQuery.inArray( value, array [, fromIndex ] )Add the following,

Why does the JavaScript need to start with “;”?

Ramu Prasad

Ramu Prasad

Updated on 23-Jun-2020 11:51:06

JavaScript uses a semi-colon (;) to avoid any confusion in code, especially the beginning of a new line.ExampleYou can still use the following to avoid any chaos in the code −return {    'var':myVal } // using semi-colon; (function( $ ) {    // }

How to set the capitalization of a text with JavaScript?

Ramu Prasad

Ramu Prasad

Updated on 23-Jun-2020 11:35:30

To set the capitalization, use the textTransform property in JavaScript. Set it to capitalize, if you want the first letter of every word to be a capital letter.ExampleYou can try to run the following code to return the capitalization of a text with JavaScript −         ... Read More

How to search the querystring part of the href attribute of an area in JavaScript?

Ramu Prasad

Ramu Prasad

Updated on 23-Jun-2020 09:23:07

To get the querystring of the href attribute of an area, use the search property. You can try to run the following code to search the querystring −Example                                                var x = document.getElementById("myarea").search;          document.write("Querystring: "+x);          

What is JavaScript Bitwise AND (&) Operator?

Ramu Prasad

Ramu Prasad

Updated on 23-Jun-2020 08:53:49

If both the bits are 1, then 1 is returned when Bitwise AND (&) operator is used.ExampleYou can try to run the following code to learn how to work with JavaScript Bitwise AND Operator −                    document.write("Bitwise AND Operator");          // 7 = 00000000000000000000000000000111          // 1 = 00000000000000000000000000000001          document.write(7 & 1);          

Set the full year for a specified date according to universal time.

Ramu Prasad

Ramu Prasad

Updated on 23-Jun-2020 08:16:39

JavaScript date setUTCFullYear() method sets the full year for a specified date according to universal time.The following are the parameters for setUTCFullYear(yearValue[, monthValue[, dayValue]]) −yearValue − An integer specifying the numeric value of the year, for example, 2008.monthValue − An integer between 0 and 11 representing the months January through ... Read More

How to get the list of document properties which can be accessed using W3C DOM?

Ramu Prasad

Ramu Prasad

Updated on 23-Jun-2020 07:06:10

The following are the document properties which can be accessed using W3C DOM −Sr.NoProperty & Description1BodyA reference to the Element object that represents the tag of this document.Ex − document.body2DefaultViewIts Read-only property and represents the window in which the document is displayed.Ex − document.defaultView3DocumentElementA read-only reference to the ... Read More

1 2 3 4 5 ... 8 Next
Advertisements