Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Javascript Articles - Page 573 of 671
3K+ Views
In this tutorial, we will learn to style the background image to no repeat with JavaScript DOM. To style the background image to no repeat with JavaScript, use the backgroundRepeat property. It allows you to set whether the background image repeats or not on a page. The use of images in the background really makes the page attractive. But before using the image in the background, one must need completely understand the properties used to set the images as the background. Otherwise, it will create problems for you like not showing the full image in the background, repeating the image ... Read More
515 Views
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"; }
4K+ Views
In this tutorial, we will explore the method by which we can get the background color of an element with JavaScript. There are many scenarios where we may want to get the color of an element on the page, and we will see how to achieve that easily using inbuilt methods provided by JavaScript. We cannot only retrieve the color of the color we can also set the color of an element using the same function. To achieve this, we will be using a modification of the same function. Browser Support Chrome Browser − Version 1.0 and above. Edge ... Read More
739 Views
In this tutorial, we will learn how to get the hash part of the href attribute of an area in JavaScript. The HTML element establishes an area within an image map with predetermined clickable zones. An image map allows you to correlate geometric regions of a picture with hypertext links. This element can only be used within the < map> element. The href property gives the area's hyperlink target. The element is not a hyperlink if the href attribute is not present. Following is a method used to get the href attribute’s hash part of an area in ... Read More
654 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.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 More
144 Views
To set the background in JavaScript, use the background property. It allows you to set the background color, image, position, etc.ExampleYou can try to run the following code to learn how to set all the background properties in a single declaration with JavaScript.Live Demo Click to Set background function display() { document.body.style.background = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg') repeat right top"; }



