Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
HTML Articles
Page 89 of 151
How to set the starting position of a background image in JavaScript DOM?
To set the starting position of a background image in JavaScript, use the backgroundposition property. It allows you to set the position of the image.ExampleYou can try to run the following code to learn how to set all the position of a background image with JavaScript −Live Demo body { background-repeat: no-repeat; } Click to Set background image function display() { document.body.style.backgroundImage = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg')"; document.body.style.backgroundPosition="top right"; }
Read MoreHow to search the querystring part of the href attribute of an area in JavaScript?
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 MoreWhat will happen when 0 is converted to Number in JavaScript?
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 −ExampleLive Demo Convert 0 to Number var myVal = 0; document.write("Number: " + Number(myVal));
Read MoreHow to set a background image to be fixed with JavaScript DOM?
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.ExampleYou can try to run the following code to learn how to work with backgroundAttachment property with JavaScript −Live Demo Click to Set background Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text ...
Read MoreWhat will happen when 1 is converted to Boolean in JavaScript?
You can try to run the following code to learn how to convert 1 to Boolean in JavaScript −ExampleLive Demo Convert 1 to Boolean var myVal = 1; document.write("Boolean: " + Boolean(myVal));
Read MoreWhich is the event when the browser window is resized in JavaScript?
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 MoreWhich event occurs in JavaScript when an element's content is cut?
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 MoreWhat is the usage of onreset event in JavaScript?
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 MoreWhat is the usage of oninput event in JavaScript?
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 MoreWhat records are present in JavaScript cookies?
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