

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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>
- Related Questions & Answers
- How to set all the outline properties in one declaration with JavaScript?
- How to set all the border left properties in one declaration with JavaScript?
- How to set all the border right properties in one declaration with JavaScript?
- How to set all the border top properties in one declaration with JavaScript?
- How to set all the background properties in one declaration with JavaScript DOM?
- How to set all the border bottom properties in one declaration in JavaScript DOM?
- How to set outline color with JavaScript?
- Set all the top border properties in one declaration using CSS
- How to set the CSS margin properties in one declaration?
- Set the width, line style and color properties for an outline in a single statement with CSS
- Set outline style as a solid single line with CSS
- How to set all the four border radius properties at once with JavaScript?
- Set all border-radius properties with CSS
- How to set the four transition properties with JavaScript?
- How to set the column rule properties with JavaScript?
Advertisements