Programming Scripts Articles

Page 17 of 33

How to get the value of the usemap attribute of an image with JavaScript?

Sravani S
Sravani S
Updated on 23-Jun-2020 240 Views

To get the value of the usemap attribute of an image, use the useMap property. You can try to run the following code to display the usemap attribute value −Example                                                var x = document.getElementById("myid").useMap;          document.write("Usemap: "+x);          

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 184 Views

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);          

Read More

What will happen when 0 is converted to Number in JavaScript?

karthikeya Boyini
karthikeya Boyini
Updated on 23-Jun-2020 140 Views

Use the Number() method in JavaScript to convert to Number. You can try to run the following code to learn how to convert 0 to Number in JavaScript − Example           Convert 0 to Number                 var myVal = 0;          document.write("Number: " + Number(myVal));           

Read More

How to set a background image to be fixed with JavaScript DOM?

Rishi Raj
Rishi Raj
Updated on 23-Jun-2020 696 Views

To set the background image to be fixed in JavaScript, use the backgroundAttachment property. It allows you to set an image that won't scroll. Example You can try to run the following code to learn how to work with backgroundAttachment property with JavaScript –       Click to Set background    Demo Text    Demo Text    Demo Text    Demo Text    Demo Text    Demo Text    Demo Text    Demo Text    Demo Text    Demo Text    Demo Text    Demo Text    Demo Text    Demo Text    Demo Text    Demo Text          function display() {       document.body.style.background = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg') no-repeat right top";       document.body.style.backgroundAttachment = "fixed";      } ...

Read More

What will happen when 1 is converted to Boolean in JavaScript?

Paul Richard
Paul Richard
Updated on 23-Jun-2020 167 Views

You can try to run the following code to learn how to convert 1 to Boolean in JavaScript − Example       Convert 1 to Boolean          var myVal = 1;      document.write("Boolean: " + Boolean(myVal));       

Read More

Which is the event when the browser window is resized in JavaScript?

Nishtha Thakur
Nishtha Thakur
Updated on 23-Jun-2020 185 Views

Use window.outerWidth and window.outerHeight event in JavaScript to get the size of windows when the browser is resized.ExampleYou can try to run the following code to work with events to check the browser window size −                    function resizeFunction() {             var val = "Window Width=" + window.outerWidth + ", Window Height="             + window.outerHeight;             document.getElementById("test").innerHTML = val;          }                     Resize browser window and check the window (browser window)       height and width again.          

Read More

Which event occurs in JavaScript when an element's content is cut?

V Jyothi
V Jyothi
Updated on 23-Jun-2020 178 Views

The oncut event occurs when an element’s content is cut. You can try to run the following code to learn how to work with an oncut event in JavaScript −Example                          function cutFunction() {             document.write("Text cut!");          }          

Read More

What is the usage of onreset event in JavaScript?

Anjana
Anjana
Updated on 23-Jun-2020 432 Views

The onreset event is useful when a form is reset. You can try to run the following code to learn how to implement onreset event in JavaScript −Example                    function resetFunct() {             alert("The form was reset");          }                      Enter age:          Enter birth month:                    

Read More

What is the usage of oninput event in JavaScript?

Sai Nath
Sai Nath
Updated on 23-Jun-2020 413 Views

When a value is added in an input box, then the oninput event occurs. You can try to run the following code to learn how to implement oninput event in JavaScript −Example           Write below:                            function inputFunc() {             var a = document.getElementById("newInput").value;             document.write("Typed: " + a);          }          

Read More

What records are present in JavaScript cookies?

Daniol Thomas
Daniol Thomas
Updated on 23-Jun-2020 244 Views

Your server sends some data to the visitor's browser in the form of a cookie. The browser may accept the cookie. If it does, it is stored as a plain text record on the visitor's hard drive. Now, when the visitor arrives at another page on your site, the browser sends the same cookie to the server for retrieval. Once retrieved, your server knows/remembers what was stored earlier.Cookies are a plain text data record of 5 variable-length fields −Expires − The date the cookie will expire. If this is blank, the cookie will expire when the visitor quits the browser.Domain − The ...

Read More
Showing 161–170 of 328 articles
« Prev 1 15 16 17 18 19 33 Next »
Advertisements