Radhakrishna has Published 85 Articles

How to calculate the area and perimeter of a circle in JavaScript?

radhakrishna

radhakrishna

Updated on 19-Jun-2020 08:46:31

1K+ Views

To calculate the area and perimeter of a circle, you can try to run the following code −Example           JavaScript Example                        function Calculate(r) {             this.r = r;   ... Read More

How do we upload external file on a website using HTML forms?

radhakrishna

radhakrishna

Updated on 17-Jun-2020 13:25:16

5K+ Views

If you want to allow a user to upload an external file to your website, you need to use a file upload box, also known as a file select box. This is also created using the element but type attribute is set to file.ExampleLive DemoYou can try to run ... Read More

How to set cookies expiry date in JavaScript?

radhakrishna

radhakrishna

Updated on 16-Jun-2020 11:46:10

5K+ Views

Extend the life of a cookie beyond the current browser session by setting an expiration date and saving the expiry date within the cookie. This can be done by setting the ‘expires’ attribute to a date and time.ExampleYou can try to run the following example to set the expiry date ... Read More

Why should we use a semicolon after every function in JavaScript?

radhakrishna

radhakrishna

Updated on 16-Jun-2020 11:41:07

815 Views

Adding semicolons after every function is optional. To avoid undesirable results, while using functions expressions, use a semicolon.Using semicolonvar display = function () {   alert(“Hello World”); }; (function () {   // code })();Without using semicolonvar display = function () {   alert(“Hello World”); } (function () {   // code })();The first function executes immediately since we have used the semicolon.

How to save HTML Canvas as an Image with canvas.toDataURL()?

radhakrishna

radhakrishna

Updated on 04-Mar-2020 04:47:58

949 Views

Use toDataURL() method to get the image data URL of the canvas. It converts the drawing (canvas) into a64 bit encoded PNG URL.ExampleYou can try to run the following code to save the canvas as an image −                     ... Read More

Execute a script when the browser is in the process of getting the media data in HTML?

radhakrishna

radhakrishna

Updated on 03-Mar-2020 12:33:46

106 Views

Use the onprogress attribute to execute a script when the browser is in the process of getting the media data in HTML.ExampleYou can try to run the following code to implement onprogress attribute −                                        Your browser does not support HTML5 video.                      function display() {             alert("Started");          }          

How do we include the legal number intervals for an input field in HTML?

radhakrishna

radhakrishna

Updated on 03-Mar-2020 11:23:06

304 Views

Use the step attribute to include the legal number intervals for an input field in HTML. The HTML input type step attribute sets the legal number intervals. Steps are number steps like 0, 5, 10, 15, 20, etc. The step attribute can be used together with the max and min attributes to create a ... Read More

How to add the maximum value to HTML?

radhakrishna

radhakrishna

Updated on 03-Mar-2020 10:15:45

132 Views

Use the max attribute to add the maximum value in HTML. You can try to run the following code to implement max attribute − Example                    Rank:                              

Execute a script when a mouse button is released over an element in HTML?

radhakrishna

radhakrishna

Updated on 03-Mar-2020 07:04:51

225 Views

When the mouse button is released over an element, the onmouseup event triggers. You can try to run the following code to implement onmouseup attribute −Example                    This is demo heading.             Click above and then ... Read More

How do we add a noframe section in HTML?

radhakrishna

radhakrishna

Updated on 03-Mar-2020 06:01:14

262 Views

Use the tag to add a noframe section. The HTML tag is used to handle the browsers which do not support tag. This tag is used to display an alternate text message.Example           HTML noframes Tag                                                 Your browser does not support frames.                    

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