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 579 of 671
2K+ Views
To attach one or more drop shadows to a box with JavaScript, you can use the box-shadow style property. You can specify the shadow's offset, blur radius, spread radius, and color by passing values for these properties in the box-shadow property. Syntax Following is the syntax to add one or more drop shadows to the box with JavaScript − box.style.boxShadow = "offset-x offset-y blur-radius spread-radius color"; Here the box.style.boxShadow property in JavaScript allows you to add one or more drop shadows to a box element. It takes the following parameters offset-x − This is the horizontal offset of ... Read More
176 Views
The ondragstart event triggers when dragging of an element begins.You can try to run the following code to learn how to implement ondragstart JavaScript event − Example Live Demo .drag { float: left; width: 100px; height: 35px; ... Read More
10K+ Views
In JavaScript null is a predefined keyword that represents an empty value or unknown value of no value. The data type of null is an object. In this article, we will learn how to convert null into Boolean using multiple approaches which are following. Using Number() Method Using Logical OR (||) Using the ~~ operator Using Ternary Operator Concatenating null with a boolean value Using the Number() Method The Number() method in JavaScript is used to convert a value into a number. If the value is not convertible, then it will return NaN. To convert the null into ... Read More
149 Views
Use the ondrag event in JavaScript to drag an element. The ondrag event is triggered when an element is dragged.ExampleYou can try to run the following code to learn how to work with ondrag event in JavaScript. .drag { float: left; width: 100px; height: 35px; border: 2px dashed #876587; margin: 15px; padding: 10px; ... Read More
371 Views
The onsearch event is useful for search i.e. a user press ENTER or “x” key in input element. The type for is search, since it is for users to search. The onsearch event isn’t supported in Internet Explorer, Firefox, and Opera.ExampleYou can try to run the following code to learn how to implement onsearch event in JavaScript. Write what you want to search below and press "ENTER". function searchFunc() { var a = document.getElementById("newInput"); document.write("Searched = " + a.value); }
186 Views
In this tutorial, we will learn how to set a number up by which the border image area extends beyond the border box in JavaScript. To set the amount by which the border image is extended, you need to set the border outside edges. To do this we can apply the borderImageOutset style property provided in JavaScript. After creating a border image area for the HTML element, we might have to increase the area. By knowing a method to increase the border image area more than the border box, we can make the change without writing lengthy code. ... Read More
283 Views
The oninvalid event is triggered if the field value added in is invalid. Add a message if the user forgets to fill the form before submission.ExampleYou can try to run the following code to learn how to implement oninvalid event in JavaScript. function resetFunct() { alert("The form was reset"); } Enter Name: Enter birth month:
485 Views
In this tutorial, we shall learn to set the widths of the image border with JavaScript. To set the widths of the image border, use the borderImageWidth property in JavaScript. When we need an image as a border of our webpage content, we have to see how to set the width of the image border. Let us discuss the option to achieve this in brief. Using the Style borderImageWidth Property With the Style borderImageWidth property, we can set or return the widths of the image border of an element. The border image will range beyond the padding when the border ... Read More
365 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); }
