Ramu Prasad has Published 85 Answers

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 <canvas> tag. The HTML <canvas> tag is for drawing graphics, animations, etc using scripting.The following are the attributes of the <canvas> 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 <legend> tag to include a title. The HTML <legend> tag s used to define a title for <fieldset> tag. It supports the following attribute −AttributeValueDescriptionAligntopbottomleftrightDeprecated − Specifies the content alignment.ExampleYou can try to run the following code to implement <legend> tag in HTML −<!DOCTYPE html> <html>    <head> ... Read More

How to work with JavaScript Drag and drop for touch devices?

Ramu Prasad

Ramu Prasad

Updated on 24-Jun-2020 06:40:00

For JavaScript drag and drop for touch devices, you can use jQuery UI Touch Punch or Drag and Drop Touch.A lot of different events are used to successfully perform drag and drop, There are a number of different events to attach to for monitoring the entire drag and drop process −dragstartdragdragenterdragleavedragoverdropdragendTo ... 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, <!--[if lte IE 10]>Let’s see the prototype here, <!--[if lte IE 10]> <script>    if (!Array.prototype.indexOf) {       // add code    } </script> <![endif]-->Read More

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 −<!DOCTYPE html> <html>    <body>   ... Read More

How to set the bottom position of 3D elements with JavaScript?

Ramu Prasad

Ramu Prasad

Updated on 23-Jun-2020 11:25:27

To set the bottom position of 3D elements, use the JavaScript perspectiveOrigin property.ExampleYou can try to run the following code to set the bottom position of 3D elements with JavaScript. We have three divs in the code −<!DOCTYPE html> <html>    <head>       <style>          #div1 ... 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<!DOCTYPE html> <html>    <body>       <img src = "/images/html.gif" alt = "HTML Map" border = "0" usemap = "#html"/>     ... Read More

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 −<!DOCTYPE html> <html>    <body>       <script>          document.write("Bitwise AND Operator<br>"); ... Read More

1 2 3 4 5 6 7 ... 9 Next
Advertisements