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
How to set all outline properties in a single declaration with JavaScript?
To set all outline properties in one declaration, use the outline property. It sets the following properties: outline-width, outline-style, and outline-color.
Example
You can try to run the following code to learn how to work with outline properties −
<!DOCTYPE html>
<html>
<head>
<style>
#box {
border: 2px dashed blue;
}
</style>
</head>
<body>
<div id="box">This is a div.</div>
<br>
<button type="button" onclick="display()">Click to set Outline</button>
<script>
function display() {
document.getElementById("box").style.outline = "5px solid red";
}
</script>
</body>
</html>Advertisements