🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 40 (from laksa167)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ℹ️ Skipped - page is already crawled

📄
INDEXABLE
CRAWLED
1 day ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://www.w3schools.com/howto/howto_js_add_class.asp
Last Crawled2026-04-06 09:21:26 (1 day ago)
First Indexed2017-09-12 15:16:47 (8 years ago)
HTTP Status Code200
Meta TitleHow To Add a Class Name
Meta DescriptionWell organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
Meta Canonicalnull
Boilerpipe Text
How TO - Add a Class Learn how to add a class name to an element with JavaScript. Click the button to add a class to me! Add Class Step 1) Add HTML: Add a class name to the div element with id="myDIV" (in this example we use a button to add the class). Example < button onclick ="myFunction()" > Try it < /button > < div id ="myDIV" >   This is a DIV element. < /div > Step 2) Add CSS: Style the specified class name: Example .mystyle {   width : 100% ;   padding : 25px ;   background-color : coral ;   color : white ;   font-size : 25px ; } Step 3) Add JavaScript: Get the <div> element with id="myDIV" and add the "mystyle" class to it: Example function myFunction() {    var element = document. getElementById ( "myDIV" );   element. classList . add ( "mystyle" ); } Try it Yourself » Tip: Also see How To Toggle A Class . Tip: Also see How To Remove A Class . Tip: Learn more about the classList property in our JavaScript Reference. Tip: Learn more about the className property in our JavaScript Reference.
Markdown
[Tutorials]("Tutorials and References") [References]("References") [Exercises]("Exercises and Quizzes") [Certificates]("Certificates") [Menu]("Menu") Search field *×* [See More]() Sign In [★ +1](https://profile.w3schools.com/log-in?redirect_url=https%3A%2F%2Fwww.w3schools.com%2Fhowto%2Fhowto_js_add_class.asp "Your W3Schools Profile") [Get Certified](https://campus.w3schools.com/collections/course-catalog "W3Schools Certificates") [Upgrade](https://order.w3schools.com/plans "Become a PLUS user and unlock powerful features") [Teachers](https://www.w3schools.com/academy/index.php "Contact us about W3Schools Academy for educational institutions") [Spaces](https://www.w3schools.com/spaces/index.php "Get Your Own Website With W3Schools Spaces") [Bootcamps](https://www.w3schools.com/bootcamp/index.php "W3Schools Bootcamps") [Get Certified](https://campus.w3schools.com/collections/course-catalog "W3Schools Certificates") [Upgrade](https://order.w3schools.com/plans "Get personalized learning journey based on your current skills and goals") [Teachers](https://www.w3schools.com/academy/index.php "Contact us about W3Schools Academy for educational institutions") [Spaces](https://spaces.w3schools.com/ "Go to Your W3Schools Space") [Bootcamps](https://www.w3schools.com/bootcamp/index.php "W3Schools Bootcamps")  [My W3Schools](https://pathfinder.w3schools.com/ "My W3Schools") Tutorials References Exercises Certificates [Spaces](https://www.w3schools.com/spaces/index.php "Get Your Own Website With W3Schools Spaces") [Get Certified](https://campus.w3schools.com/collections/course-catalog "W3Schools Certificates") [Plus](https://order.w3schools.com/plans "Become a PLUS user and unlock powerful features") [Bootcamps](https://www.w3schools.com/bootcamp/index.php "W3Schools Bootcamps") [Academy](https://www.w3schools.com/academy/index.php "W3Schools Academy") All our Services [Logout](https://profile.w3schools.com/logout "Logout") [**](https://www.linkedin.com/company/w3schools.com/ "W3Schools on LinkedIn") [**](https://discord.com/invite/w3schools "Join the W3schools community on Discord") [**](https://www.facebook.com/w3schoolscom/ "W3Schools on Facebook") [**](https://www.instagram.com/w3schools.com_official/ "W3Schools on Instagram") × ## **Tutorials** Tutorials filter input × ### HTML and CSS [Learn HTML](https://www.w3schools.com/html/default.asp "HTML Tutorial") [Tutorial](https://www.w3schools.com/html/default.asp "HTML Tutorial") [Reference](https://www.w3schools.com/tags/default.asp "HTML Reference") [Learn CSS](https://www.w3schools.com/css/default.asp "CSS Tutorial") [Tutorial](https://www.w3schools.com/css/default.asp "CSS Tutorial") [Reference](https://www.w3schools.com/cssref/default.asp "CSS Reference") [Learn RWD](https://www.w3schools.com/css/css_rwd_intro.asp "Responsive Web Design Tutorial") [Tutorial](https://www.w3schools.com/css/css_rwd_intro.asp "Responsive Web Design Tutorial") [Learn Bootstrap](https://www.w3schools.com/bootstrap/bootstrap_ver.asp "Bootstrap Tutorials") [Overview](https://www.w3schools.com/bootstrap/bootstrap_ver.asp "Bootstrap Tutorials") [Learn W3.CSS](https://www.w3schools.com/w3css/default.asp "W3.CSS Tutorial") [Tutorial](https://www.w3schools.com/w3css/default.asp "W3.CSS Tutorial") [Reference](https://www.w3schools.com/w3css/w3css_references.asp "W3.CSS Reference") [Learn Sass](https://www.w3schools.com/sass/default.asp "SASS Tutorial") [Tutorial](https://www.w3schools.com/sass/default.asp "SASS Tutorial") [Reference](https://www.w3schools.com/sass/sass_functions_string.asp "SASS Reference") [Learn Colors](https://www.w3schools.com/colors/default.asp "Colors Tutorial") [Tutorial](https://www.w3schools.com/colors/default.asp "Colors Tutorial") [Reference](https://www.w3schools.com/colors/colors_fs595.asp "Colors Reference") [Learn Icons](https://www.w3schools.com/icons/default.asp "Icons Tutorial") [Tutorial](https://www.w3schools.com/icons/default.asp "Icons Tutorial") [Reference](https://www.w3schools.com/icons/icons_reference.asp "Icons Reference") [Learn SVG](https://www.w3schools.com/graphics/svg_intro.asp "SVG Tutorial") [Tutorial](https://www.w3schools.com/graphics/svg_intro.asp "SVG Tutorial") [Reference](https://www.w3schools.com/graphics/svg_reference.asp "SVG Reference") [Learn Canvas](https://www.w3schools.com/graphics/canvas_intro.asp "Canvas Tutorial") [Tutorial](https://www.w3schools.com/graphics/canvas_intro.asp "Canvas Tutorial") [Reference](https://www.w3schools.com/graphics/canvas_reference.asp "Canvas Reference") [Learn Graphics](https://www.w3schools.com/graphics/default.asp "Graphics Tutorial") [Tutorial](https://www.w3schools.com/graphics/default.asp "Graphics Tutorial") [Learn UTF-8 and Emojis](https://www.w3schools.com/charsets/default.asp "UTF-8 and Emojis Reference") [Reference](https://www.w3schools.com/charsets/default.asp "UTF-8 and Emojis Reference") [Learn How To](https://www.w3schools.com/howto/default.asp "How To - Code Snippets") [Tutorial](https://www.w3schools.com/howto/default.asp "How To - Code Snippets") ### Data Analytics [Learn AI](https://www.w3schools.com/ai/default.asp "Artificial Intelligence Tutorial") [Tutorial](https://www.w3schools.com/ai/default.asp "Artificial Intelligence Tutorial") [Learn Generative AI](https://www.w3schools.com/gen_ai/index.php "Generative AI Tutorial") [Tutorial](https://www.w3schools.com/gen_ai/index.php "Generative AI Tutorial") [Learn ChatGPT-3.5](https://www.w3schools.com/gen_ai/chatgpt-3-5/index.php "ChatGPT-3.5 Tutorial") [Tutorial](https://www.w3schools.com/gen_ai/chatgpt-3-5/index.php "ChatGPT-3.5 Tutorial") [Learn ChatGPT-4](https://www.w3schools.com/gen_ai/chatgpt-4/index.php "ChatGPT-4 Tutorial") [Tutorial](https://www.w3schools.com/gen_ai/chatgpt-4/index.php "ChatGPT-4 Tutorial") [Learn Google Bard](https://www.w3schools.com/gen_ai/bard/index.php "Google Bard Tutorial") [Tutorial](https://www.w3schools.com/gen_ai/bard/index.php "Google Bard Tutorial") [Learn Machine Learning](https://www.w3schools.com/python/python_ml_getting_started.asp "Machine Learning Tutorial") [Tutorial](https://www.w3schools.com/python/python_ml_getting_started.asp "Machine Learning Tutorial") [Learn DSA](https://www.w3schools.com/dsa/index.php "DSA - Data Structures and Algorithms") [Tutorial](https://www.w3schools.com/dsa/index.php "DSA - Data Structures and Algorithms") [Learn Data Science](https://www.w3schools.com/datascience/default.asp "Data Science Tutorial") [Tutorial](https://www.w3schools.com/datascience/default.asp "Data Science Tutorial") [Learn NumPy](https://www.w3schools.com/python/numpy/default.asp "NumPy Tutorial") [Tutorial](https://www.w3schools.com/python/numpy/default.asp "NumPy Tutorial") [Learn Pandas](https://www.w3schools.com/python/pandas/default.asp "Pandas Tutorial") [Tutorial](https://www.w3schools.com/python/pandas/default.asp "Pandas Tutorial") [Learn SciPy](https://www.w3schools.com/python/scipy/index.php "SciPy Tutorial") [Tutorial](https://www.w3schools.com/python/scipy/index.php "SciPy Tutorial") [Learn Matplotlib](https://www.w3schools.com/python/matplotlib_intro.asp "Matplotlib Tutorial") [Tutorial](https://www.w3schools.com/python/matplotlib_intro.asp "Matplotlib Tutorial") [Learn Statistics](https://www.w3schools.com/statistics/index.php "Statistics Tutorial") [Tutorial](https://www.w3schools.com/statistics/index.php "Statistics Tutorial") [Learn Excel](https://www.w3schools.com/excel/index.php "Excel Tutorial") [Tutorial](https://www.w3schools.com/excel/index.php "Excel Tutorial") [Learn Google Sheets](https://www.w3schools.com/googlesheets/index.php "Google Sheets Tutorial") [Tutorial](https://www.w3schools.com/googlesheets/index.php "Google Sheets Tutorial") ### Web Building [Create a Website](https://www.w3schools.com/spaces/index.php "Get Your Own Website With W3schools Spaces") [Create a Server NEW](https://www.w3schools.com/spaces/index.php "Get Your Own Server With W3schools Spaces") [Where To Start](https://www.w3schools.com/where_to_start.asp "Where To Start - Web Development") [Web Templates](https://www.w3schools.com/w3css/w3css_templates.asp "Free Web Templates") [Web Statistics](https://www.w3schools.com/browsers/default.asp "Web Statistics") [Web Certificates](https://campus.w3schools.com/ "Certificates") [Web Development](https://www.w3schools.com/whatis/default.asp "Web Development Roadmaps") [Introduction to Programming](https://www.w3schools.com/programming/index.php "Introduction to Programming") [Introduction to HTML & CSS](https://www.w3schools.com/htmlcss/default.asp "HTML & CSS") [Code Editor](https://www.w3schools.com/tryit/default.asp "Try it - Code Editor") [Test Your Typing Speed](https://www.w3schools.com/typingspeed/default.asp "Test Your Typing Speed") [Play a Code Game](https://www.w3schools.com/codegame/index.html "Play a Code Game") [Web Development Tools](https://www.w3schools.com/tools/index.php "Web Development Tools") [Cyber Security](https://www.w3schools.com/cybersecurity/index.php "Cyber Security Tutorial") [Accessibility](https://www.w3schools.com/accessibility/index.php "Accessibility Security Tutorial") [Join our Newsletter](https://campus.w3schools.com/pages/newsletter "W3Schools Newsletter") ### JavaScript [Learn JavaScript](https://www.w3schools.com/js/default.asp "JavaScript Tutorial") [Tutorial](https://www.w3schools.com/js/default.asp "JavaScript Tutorial") [Reference](https://www.w3schools.com/jsref/default.asp "JavaScript Reference") [Learn React](https://www.w3schools.com/react/default.asp "React Tutorial") [Tutorial](https://www.w3schools.com/react/default.asp "React Tutorial") [Learn jQuery](https://www.w3schools.com/jquery/default.asp "jQuery Tutorial") [Tutorial](https://www.w3schools.com/jquery/default.asp "jQuery Tutorial") [Reference](https://www.w3schools.com/jquery/jquery_ref_overview.asp "jQuery Reference") [Learn Vue](https://www.w3schools.com/vue/index.php "Vue Tutorial") [Tutorial](https://www.w3schools.com/vue/index.php "Vue Tutorial") [Reference](https://www.w3schools.com/vue/vue_ref_builtin-attributes.php "Vue Reference") [Learn Angular](https://www.w3schools.com/angular/default.asp "Angular Tutorial") [Tutorial](https://www.w3schools.com/angular/default.asp "Angular Tutorial") [Learn AngularJS](https://www.w3schools.com/angularjs/default.asp "AngularJS Tutorial") [Tutorial](https://www.w3schools.com/angularjs/default.asp "AngularJS Tutorial") [Reference](https://www.w3schools.com/angularjs/angularjs_ref_directives.asp "AngularJS Reference") [Learn JSON](https://www.w3schools.com/js/js_json_intro.asp "JSON Tutorial") [Tutorial](https://www.w3schools.com/js/js_json_intro.asp "JSON Tutorial") [Reference](https://www.w3schools.com/jsref/jsref_obj_json.asp "JSON Reference") [Learn AJAX](https://www.w3schools.com/js/js_ajax_intro.asp "AJAX Tutorial") [Tutorial](https://www.w3schools.com/js/js_ajax_intro.asp "AJAX Tutorial") [Learn AppML](https://www.w3schools.com/appml/default.asp "AppML Tutorial") [Tutorial](https://www.w3schools.com/appml/default.asp "AppML Tutorial") [Reference](https://www.w3schools.com/appml/appml_reference.asp "AppML Reference") [Learn W3.JS](https://www.w3schools.com/w3js/default.asp "W3.JS Tutorial") [Tutorial](https://www.w3schools.com/w3js/default.asp "W3.JS Tutorial") [Reference](https://www.w3schools.com/w3js/w3js_references.asp "W3.JS Reference") ### Web Building [Create a Website](https://www.w3schools.com/spaces/index.php "Get Your Own Website With W3schools Spaces") [Create a Server NEW](https://www.w3schools.com/spaces/index.php "Get Your Own Server With W3schools Spaces") [Where To Start](https://www.w3schools.com/where_to_start.asp "Where To Start - Web Development") [Web Templates](https://www.w3schools.com/w3css/w3css_templates.asp "Free Web Templates") [Web Statistics](https://www.w3schools.com/browsers/default.asp "Web Statistics") [Web Certificates](https://campus.w3schools.com/ "Certificates") [Web Development](https://www.w3schools.com/whatis/default.asp "Web Development Roadmaps") [Introduction to Programming](https://www.w3schools.com/programming/index.php "Introduction to Programming") [Introduction to HTML & CSS](https://www.w3schools.com/htmlcss/default.asp "HTML & CSS") [Code Editor](https://www.w3schools.com/tryit/default.asp "Try it - Code Editor") [Test Your Typing Speed](https://www.w3schools.com/typingspeed/default.asp "Test Your Typing Speed") [Play a Code Game](https://www.w3schools.com/codegame/index.html "Play a Code Game") [Web Developer Tools](https://www.w3schools.com/tools/index.php "Web Developer Tools") [Cyber Security](https://www.w3schools.com/cybersecurity/index.php "Cyber Security Tutorial") [Accessibility](https://www.w3schools.com/accessibility/index.php "Accessibility Security Tutorial") [Join our Newsletter](https://campus.w3schools.com/pages/newsletter "W3Schools Newsletter") ### Backend [Learn Python](https://www.w3schools.com/python/default.asp "Python Tutorial") [Tutorial](https://www.w3schools.com/python/default.asp "Python Tutorial") [Reference](https://www.w3schools.com/python/python_reference.asp "Python Reference") [Learn SQL](https://www.w3schools.com/sql/default.asp "SQL Tutorial") [Tutorial](https://www.w3schools.com/sql/default.asp "SQL Tutorial") [Reference](https://www.w3schools.com/sql/sql_ref_keywords.asp "SQL Reference") [Learn MySQL](https://www.w3schools.com/mysql/default.asp "MySQL Tutorial") [Tutorial](https://www.w3schools.com/mysql/default.asp "MySQL Tutorial") [Reference](https://www.w3schools.com/mysql/mysql_datatypes.asp "MySQL Reference") [Learn PHP](https://www.w3schools.com/php/default.asp "PHP Tutorial") [Tutorial](https://www.w3schools.com/php/default.asp "PHP Tutorial") [Reference](https://www.w3schools.com/php/php_ref_overview.asp "PHP Reference") [Learn Java](https://www.w3schools.com/java/default.asp "Java Tutorial") [Tutorial](https://www.w3schools.com/java/default.asp "Java Tutorial") [Reference](https://www.w3schools.com/java/java_ref_reference.asp "Java Reference") [Learn C](https://www.w3schools.com/c/index.php "C Tutorial") [Tutorial](https://www.w3schools.com/c/index.php "C Tutorial") [Reference](https://www.w3schools.com/c/c_ref_reference.php "C Reference") [Learn C++](https://www.w3schools.com/cpp/default.asp "C++ Tutorial") [Tutorial](https://www.w3schools.com/cpp/default.asp "C++ Tutorial") [Reference](https://www.w3schools.com/cpp/cpp_ref_reference.asp "C++ Reference") [Learn C\#](https://www.w3schools.com/cs/index.php "C# Tutorial") [Tutorial](https://www.w3schools.com/cs/index.php "C# Tutorial") [Learn R](https://www.w3schools.com/r/default.asp "R Tutorial") [Tutorial](https://www.w3schools.com/r/default.asp "R Tutorial") [Learn Kotlin](https://www.w3schools.com/kotlin/index.php "Kotlin Tutorial") [Tutorial](https://www.w3schools.com/kotlin/index.php "Kotlin Tutorial") [Learn Rust](https://www.w3schools.com/rust/index.php "Rust Tutorial") [Tutorial](https://www.w3schools.com/rust/index.php "Rust Tutorial") [Learn Go](https://www.w3schools.com/go/index.php "Go Tutorial") [Tutorial](https://www.w3schools.com/go/index.php "Go Tutorial") [Learn Django](https://www.w3schools.com/django/index.php "Django Tutorial") [Tutorial](https://www.w3schools.com/django/index.php "Django Tutorial") [Reference](https://www.w3schools.com/django/django_ref_template_tags.php "Django Reference") [Learn PostgreSQL](https://www.w3schools.com/postgresql/index.php "PostgreSQL Tutorial") [Tutorial](https://www.w3schools.com/postgresql/index.php "PostgreSQL Tutorial") [Learn TypeScript](https://www.w3schools.com/typescript/index.php "TypeScript Tutorial") [Tutorial](https://www.w3schools.com/typescript/index.php "TypeScript Reference") [Learn ASP](https://www.w3schools.com/asp/default.asp "ASP Tutorial") [Tutorial](https://www.w3schools.com/asp/default.asp "ASP Tutorial") [Reference](https://www.w3schools.com/asp/asp_ref_vbscript_functions.asp "ASP Reference") [Learn Node.js](https://www.w3schools.com/nodejs/default.asp "Node.js Tutorial") [Tutorial](https://www.w3schools.com/nodejs/default.asp "Node.js Tutorial") [Reference](https://www.w3schools.com/nodejs/ref_modules.asp "Node.js Reference") [Learn Raspberry Pi](https://www.w3schools.com/nodejs/nodejs_raspberrypi.asp "Raspberry Pi Tutorial") [Tutorial](https://www.w3schools.com/nodejs/nodejs_raspberrypi.asp "Raspberry Pi Tutorial") [Learn Swift](https://www.w3schools.com/swift/default.asp "Swift Tutorial") [Tutorial](https://www.w3schools.com/swift/default.asp "Swift Tutorial") [Learn Git](https://www.w3schools.com/git/default.asp "Git Tutorial") [Tutorial](https://www.w3schools.com/git/default.asp "Git Tutorial") [Learn Bash](https://www.w3schools.com/bash/index.php "Bash Tutorial") [Tutorial](https://www.w3schools.com/bash/index.php "Bash Tutorial") [Learn MongoDB](https://www.w3schools.com/mongodb/index.php "MongoDB Tutorial") [Tutorial](https://www.w3schools.com/mongodb/index.php "MongoDB Tutorial") [Learn AWS Cloud](https://www.w3schools.com/aws/index.php "AWS Cloud Tutorial") [Tutorial](https://www.w3schools.com/aws/index.php "AWS Cloud Tutorial") [Learn XML](https://www.w3schools.com/xml/default.asp "XML Tutorial") [Tutorial](https://www.w3schools.com/xml/default.asp "XML Tutorial") [Reference](https://www.w3schools.com/xml/dom_nodetype.asp "XML Reference") ### Data Analytics [Learn AI](https://www.w3schools.com/ai/default.asp "Artificial Intelligence Tutorial") [Tutorial](https://www.w3schools.com/ai/default.asp "Artificial Intelligence Tutorial") [Learn Generative AI](https://www.w3schools.com/gen_ai/index.php "Generative AI Tutorial") [Tutorial](https://www.w3schools.com/gen_ai/index.php "Generative AI Tutorial") [Learn ChatGPT-3.5](https://www.w3schools.com/gen_ai/chatgpt-3-5/index.php "ChatGPT-3.5 Tutorial") [Tutorial](https://www.w3schools.com/gen_ai/chatgpt-3-5/index.php "ChatGPT-3.5 Tutorial") [Learn ChatGPT-4](https://www.w3schools.com/gen_ai/chatgpt-4/index.php "ChatGPT-4 Tutorial") [Tutorial](https://www.w3schools.com/gen_ai/chatgpt-4/index.php "ChatGPT-4 Tutorial") [Learn Google Bard](https://www.w3schools.com/gen_ai/bard/index.php "Google Bard Tutorial") [Tutorial](https://www.w3schools.com/gen_ai/bard/index.php "Google Bard Tutorial") [Learn Machine Learning](https://www.w3schools.com/python/python_ml_getting_started.asp "Machine Learning Tutorial") [Tutorial](https://www.w3schools.com/python/python_ml_getting_started.asp "Machine Learning Tutorial") [Learn DSA](https://www.w3schools.com/dsa/index.php "DSA - Data Structures and Algorithms") [Tutorial](https://www.w3schools.com/dsa/index.php "DSA - Data Structures and Algorithms ") [Learn Data Science](https://www.w3schools.com/datascience/default.asp "Data Science Tutorial") [Tutorial](https://www.w3schools.com/datascience/default.asp "Data Science Tutorial") [Learn NumPy](https://www.w3schools.com/python/numpy/default.asp "NumPy Tutorial") [Tutorial](https://www.w3schools.com/python/numpy/default.asp "NumPy Tutorial") [Learn Pandas](https://www.w3schools.com/python/pandas/default.asp "Pandas Tutorial") [Tutorial](https://www.w3schools.com/python/pandas/default.asp "Pandas Tutorial") [Learn SciPy](https://www.w3schools.com/python/scipy/index.php "SciPy Tutorial") [Tutorial](https://www.w3schools.com/python/scipy/index.php "SciPy Tutorial") [Learn Matplotlib](https://www.w3schools.com/python/matplotlib_intro.asp "Matplotlib Tutorial") [Tutorial](https://www.w3schools.com/python/matplotlib_intro.asp "Matplotlib Tutorial") [Learn Statistics](https://www.w3schools.com/statistics/index.php "Statistics Tutorial") [Tutorial](https://www.w3schools.com/statistics/index.php "Statistics Tutorial") [Learn Excel](https://www.w3schools.com/excel/index.php "Excel Tutorial") [Tutorial](https://www.w3schools.com/excel/index.php "Excel Tutorial") [Learn Google Sheets](https://www.w3schools.com/googlesheets/index.php "Google Sheets Tutorial") [Tutorial](https://www.w3schools.com/googlesheets/index.php "Google Sheets Tutorial") ### Web Building [Create a Website](https://www.w3schools.com/spaces/index.php "Get Your Own Website With W3schools Spaces") [Create a Server NEW](https://www.w3schools.com/spaces/index.php "Get Your Own Server With W3schools Spaces") [Where To Start](https://www.w3schools.com/where_to_start.asp "Where To Start - Web Development") [Web Templates](https://www.w3schools.com/w3css/w3css_templates.asp "Free Web Templates") [Web Statistics](https://www.w3schools.com/browsers/default.asp "Web Statistics") [Web Certificates](https://campus.w3schools.com/ "Certificates") [Web Development](https://www.w3schools.com/whatis/default.asp "Web Development Roadmaps") [Introduction to Programming](https://www.w3schools.com/programming/index.php "Introduction to Programming") [Introduction to HTML & CSS](https://www.w3schools.com/htmlcss/default.asp "HTML & CSS") [Code Editor](https://www.w3schools.com/tryit/default.asp "Try it - Code Editor") [Test Your Typing Speed](https://www.w3schools.com/typingspeed/default.asp "Test Your Typing Speed") [Play a Code Game](https://www.w3schools.com/codegame/index.html "Play a Code Game") [Web Developer Tools](https://www.w3schools.com/tools/index.php "Web Developer Tools") [Cyber Security](https://www.w3schools.com/cybersecurity/index.php "Cyber Security Tutorial") [Accessibility](https://www.w3schools.com/accessibility/index.php "Accessibility Security Tutorial") [Join our Newsletter](https://campus.w3schools.com/pages/newsletter "W3Schools Newsletter") × ## **References** References filter input × ### HTML and CSS [HTML Tags Reference](https://www.w3schools.com/tags/default.asp "HTML Tag Reference") [CSS Reference](https://www.w3schools.com/cssref/default.asp "CSS Reference") [W3.CSS Reference](https://www.w3schools.com/w3css/w3css_references.asp "W3.CSS Reference") [Bootstrap 3 Reference](https://www.w3schools.com/bootstrap/bootstrap_ref_all_classes.asp "Bootstrap3 Reference") [Bootstrap 4 Reference](https://www.w3schools.com/bootstrap4/bootstrap_ref_all_classes.asp "Bootstrap4 Reference") [Color Names](https://www.w3schools.com/colors/colors_names.asp "Color Names") [Icons Reference](https://www.w3schools.com/icons/default.asp "Icons Reference") [SVG Reference](https://www.w3schools.com/graphics/svg_reference.asp "SVG Reference") [Canvas Reference](https://www.w3schools.com/graphics/canvas_reference.asp "Canvas Reference") [Sass Reference](https://www.w3schools.com/sass/sass_functions_string.php "SASS Reference") [UTF-8 Charset Reference](https://www.w3schools.com/charsets/default.asp "UTF-8 Reference") [UTF-8 Emojis Reference](https://www.w3schools.com/charsets/ref_emoji_smileys.asp "UTF-8 Emojis Reference") ### JavaScript [JavaScript Reference](https://www.w3schools.com/jsref/default.asp "JavaScript Reference") [HTML DOM Reference](https://www.w3schools.com/jsref/dom_obj_document.asp "HTML DOM Reference") [jQuery Reference](https://www.w3schools.com/jquery/jquery_ref_overview.asp "jQuery Reference") [Vue Reference](https://www.w3schools.com/vue/vue_ref_builtin-attributes.php "Vue Reference") [Angular Reference](https://www.w3schools.com/angular/angularjs_ref_directives.asp "Angular Reference") [JSON Reference](https://www.w3schools.com/jsref/jsref_obj_json.asp "JSON Reference") [AppML Reference](https://www.w3schools.com/appml/appml_reference.asp "AppML Reference") [W3.JS Reference](https://www.w3schools.com/e3js/w3js_references.asp "W3.JS Reference") ### Backend [Python Reference](https://www.w3schools.com/python/python_reference.asp "Python Reference") [SQL Reference](https://www.w3schools.com/sql/sql_ref_keywords.asp "SQL Reference") [MySQL Reference](https://www.w3schools.com/mysql/mysql_datatypes.asp "MySQL Reference") [PHP Reference](https://www.w3schools.com/php/php_ref_overview.asp "PHP Reference") [Java Reference](https://www.w3schools.com/java/java_ref_reference.asp "Java Reference") [C Reference](https://www.w3schools.com/c/c_ref_reference.php "C Reference") [C++ Reference](https://www.w3schools.com/cpp/cpp_ref_reference.asp "C++ Reference") [Django Reference](https://www.w3schools.com/django/django_ref_template_tags.php "Django Reference") [ASP Reference](https://www.w3schools.com/asp/asp_ref_vbscript_functions.asp "ASP Reference") [Node.js Reference](https://www.w3schools.com/nodejs/ref_modules.asp "Node.js Reference") [XML Reference](https://www.w3schools.com/xml/dom_nodetype.asp "XML Reference") × ## **Exercises** Excercises filter input × ### HTML and CSS [HTML](https://www.w3schools.com/html/html_exercises.asp "HTML Exercises") [Exercise](https://www.w3schools.com/html/html_exercises.asp "HTML Exercises") [Quiz](https://www.w3schools.com/html/html_quiz.asp "HTML Quizzes") [Challenge](https://www.w3schools.com/html/html_challenges.asp "HTML Code Challenges") [CSS](https://www.w3schools.com/css/css_exercises.asp "CSS Exercises") [Exercise](https://www.w3schools.com/css/css_exercises.asp "CSS Exercises") [Quiz](https://www.w3schools.com/css/css_quiz.asp "CSS Quizzes") [Challenge](https://www.w3schools.com/css/css_challenges.asp "CSS Code Challenges") [Bootstrap 3](https://www.w3schools.com/bootstrap/bootstrap_exercises.asp "Bootstrap 3 Exercises") [Exercise](https://www.w3schools.com/bootstrap/bootstrap_exercises.asp "Bootstrap 3 Exercises") [Quiz](https://www.w3schools.com/bootstrap/bootstrap_quiz.asp "Bootstrap 3 Quizzes") [Bootstrap 4](https://www.w3schools.com/bootstrap4/bootstrap_exercises.asp "Bootstrap 4 Exercises") [Exercise](https://www.w3schools.com/bootstrap4/bootstrap_exercises.asp "Bootstrap 4 Exercises") [Quiz](https://www.w3schools.com/bootstrap4/bootstrap_quiz.asp "Bootstrap 4 Quizzes") [Bootstrap 5](https://www.w3schools.com/bootstrap5/bootstrap_exercises.php "Bootstrap 5 Exercises") [Exercise](https://www.w3schools.com/bootstrap5/bootstrap_exercises.php "Bootstrap 5 Exercises") [Quiz](https://www.w3schools.com/bootstrap5/bootstrap_quiz.php "Bootstrap 5 Quizzes") ### Data Analytics [DSA](https://www.w3schools.com/dsa/dsa_exercises.php "DSA Exercises") [Exercise](https://www.w3schools.com/dsa/dsa_exercises.php "DSA Exercises") [Quiz](https://www.w3schools.com/dsa/dsa_quiz.php "DSA Quizzes") [NumPy](https://www.w3schools.com/python/numpy/numpy_exercises.asp "NumPy Exercises") [Exercise](https://www.w3schools.com/python/numpy/numpy_exercises.asp "NumPy Exercises") [Quiz](https://www.w3schools.com/python/numpy/numpy_quiz.asp "NumPy Quizzes") [Pandas](https://www.w3schools.com/python/pandas/pandas_exercises.asp "Pandas Exercises") [Exercise](https://www.w3schools.com/python/pandas/pandas_exercises.asp "Pandas Exercises") [Quiz](https://www.w3schools.com/python/pandas/pandas_quiz.asp "Pandas Quizzes") [SciPy](https://www.w3schools.com/python/scipy/scipy_exercises.php "SciPy Exercises") [Exercise](https://www.w3schools.com/python/scipy/scipy_exercises.php "SciPy Exercises") [Quiz](https://www.w3schools.com/python/scipy/scipy_quiz.php "SciPy Quizzes") [Excel](https://www.w3schools.com/excel/excel_exercises.php "Excel Exercises") [Exercise](https://www.w3schools.com/excel/excel_exercises.php "Excel Exercises") [What is an Exercise?](https://www.w3schools.com/exercises/index.php "W3Schools Exercises") [What is a Quiz?](https://www.w3schools.com/quiztest/default.asp "W3Schools Quizzes") [What is a Challenge?](https://www.w3schools.com/challenges/index.php "W3Schools Challenges") ### JavaScript [JavaScript](https://www.w3schools.com/js/js_exercises.asp "JavaScript Exercises") [Exercise](https://www.w3schools.com/js/js_exercises.asp "JavaScript Exercises") [Quiz](https://www.w3schools.com/js/js_quiz.asp "JavaScript Quizzes") [React](https://www.w3schools.com/react/react_exercises.asp "React Exercises") [Exercise](https://www.w3schools.com/react/react_exercises.asp "React Exercises") [Quiz](https://www.w3schools.com/react/react_quiz.asp "React Quizzes") [jQuery](https://www.w3schools.com/jquery/jquery_exercises.asp "jQuery Exercises") [Exercise](https://www.w3schools.com/jquery/jquery_exercises.asp "jQuery Exercises") [Quiz](https://www.w3schools.com/jquery/jquery_quiz.asp "jQuery Quizzes") [Vue](https://www.w3schools.com/vue/vue_exercises.php "Vue Exercises") [Exercise](https://www.w3schools.com/vue/vue_exercises.php "Vue Exercises") [Quiz](https://www.w3schools.com/vue/vue_quiz.php "Vue Quizzes") [Angular](https://www.w3schools.com/angular/angular_exercises.asp "Angular Exercises") [Exercise](https://www.w3schools.com/angular/angular_exercises.asp "Angular Exercises") [Quiz](https://www.w3schools.com/angular/angular_quiz.asp "Angular Quizzes") ### Backend [Python](https://www.w3schools.com/python/python_exercises.asp "Python Exercises") [Exercise](https://www.w3schools.com/python/python_exercises.asp "Python Exercises") [Quiz](https://www.w3schools.com/python/python_quiz.asp "Python Quizzes") [Challenge](https://www.w3schools.com/python/python_challenges.asp "Python Code Challenges") [SQL](https://www.w3schools.com/sql/sql_exercises.asp "SQL Exercises") [Exercise](https://www.w3schools.com/sql/sql_exercises.asp "SQL Exercises") [Quiz](https://www.w3schools.com/sql/sql_quiz.asp "SQL Quizzes") [MySQL](https://www.w3schools.com/mysql/mysql_exercises.asp "MySQL Exercises") [Exercise](https://www.w3schools.com/mysql/mysql_exercises.asp "MySQL Exercises") [Quiz](https://www.w3schools.com/mysql/mysql_quiz.asp "MySQL Quizzes") [PHP](https://www.w3schools.com/php/php_exercises.asp "PHP Exercises") [Exercise](https://www.w3schools.com/php/php_exercises.asp "PHP Exercises") [Quiz](https://www.w3schools.com/php/php_quiz.asp "PHP Quizzes") [Java](https://www.w3schools.com/java/java_exercises.asp "Java Exercises") [Exercise](https://www.w3schools.com/java/java_exercises.asp "Java Exercises") [Quiz](https://www.w3schools.com/java/java_quiz.asp "Java Quizzes") [Challenge](https://www.w3schools.com/java/java_challenges.asp "Java Code Challenges") [C](https://www.w3schools.com/c/c_exercises.php "C Exercises") [Exercise](https://www.w3schools.com/c/c_exercises.php "C Exercises") [Quiz](https://www.w3schools.com/c/c_quiz.php "C Quizzes") [Challenge](https://www.w3schools.com/c/c_challenges.php "C Challenges") [C++](https://www.w3schools.com/cpp/cpp_exercises.asp "C++ Exercises") [Exercise](https://www.w3schools.com/cpp/cpp_exercises.asp "C++ Exercises") [Quiz](https://www.w3schools.com/cpp/cpp_quiz.asp "C++ Quizzes") [Challenge](https://www.w3schools.com/cpp/cpp_challenges.asp "C++ Code Challenges") [C\#](https://www.w3schools.com/cs/cs_exercises.php "C# Exercises") [Exercise](https://www.w3schools.com/cs/cs_exercises.php "C# Exercises") [Quiz](https://www.w3schools.com/cs/cs_quiz.php "C# Quizzes") [R](https://www.w3schools.com/r/r_exercises.asp "R Exercises") [Exercise](https://www.w3schools.com/r/r_exercises.asp "R Exercises") [Quiz](https://www.w3schools.com/r/r_quiz.asp "R Quizzes") [Kotlin](https://www.w3schools.com/kotlin/kotlin_exercises.php "Kotlin Exercises") [Exercise](https://www.w3schools.com/kotlin/kotlin_exercises.php "Kotlin Exercises") [Quiz](https://www.w3schools.com/kotlin/kotlin_quiz.php "Kotlin Quizzes") [Django](https://www.w3schools.com/django/django_exercises.php "Django Exercises") [Exercise](https://www.w3schools.com/django/django_exercises.php "Django Exercises") [Quiz](https://www.w3schools.com/django/django_quiz.php "Django Quizzes") [Node.js](https://www.w3schools.com/nodejs/nodejs_exercises.asp "Node.js Exercises") [Exercise](https://www.w3schools.com/nodejs/nodejs_exercises.asp "Node.js Exercises") [Quiz](https://www.w3schools.com/nodejs/nodejs_quiz.asp "Node.js Quizzes") [PostgreSQL](https://www.w3schools.com/postgresql/postgresql_exercises.php "PostgreSQL Exercises") [Exercise](https://www.w3schools.com/postgresql/postgresql_exercises.php "PostgreSQL Exercises") [Quiz](https://www.w3schools.com/postgresql/postgresql_quiz.php "PostgreSQL Quizzes") [TypeScript](https://www.w3schools.com/typescript/typescript_exercises.php "TypeScript Exercises") [Exercise](https://www.w3schools.com/typescript/typescript_exercises.php "TypeScript Exercises") [Quiz](https://www.w3schools.com/typescript/typescript_quiz.php "TypeScript Quizzes") [Git](https://www.w3schools.com/git/git_exercises.asp "Git Exercises") [Exercise](https://www.w3schools.com/git/git_exercises.asp "Git Exercises") [Quiz](https://www.w3schools.com/git/git_quiz.asp "Git Quizzes") [Bash](https://www.w3schools.com/bash/bash_exercises.php "Bash Exercises") [Exercise](https://www.w3schools.com/bash/bash_exercises.php "Bash Exercises") [Quiz](https://www.w3schools.com/bash/bash_quiz.php "Bash Quizzes") [Go](https://www.w3schools.com/go/go_exercises.php "Go Exercises") [Exercise](https://www.w3schools.com/go/go_exercises.php "Go Exercises") [MongoDB](https://www.w3schools.com/mongodb/mongodb_exercises.php "MongoDB Exercises") [Exercise](https://www.w3schools.com/mongodb/mongodb_exercises.php "MongoDB Exercises") ### Data Analytics [DSA](https://www.w3schools.com/dsa/dsa_exercises.php "DSA Exercises") [Exercise](https://www.w3schools.com/dsa/dsa_exercises.php "DSA Exercises") [Quiz](https://www.w3schools.com/dsa/dsa_quiz.php "DSA Quizzes") [NumPy](https://www.w3schools.com/python/numpy/numpy_exercises.asp "NumPy Exercises") [Exercise](https://www.w3schools.com/python/numpy/numpy_exercises.asp "NumPy Exercises") [Quiz](https://www.w3schools.com/python/numpy/numpy_quiz.asp "NumPy Quizzes") [Pandas](https://www.w3schools.com/python/pandas/pandas_exercises.asp "Pandas Exercises") [Exercise](https://www.w3schools.com/python/pandas/pandas_exercises.asp "Pandas Exercises") [Quiz](https://www.w3schools.com/python/pandas/pandas_quiz.asp "Pandas Quizzes") [SciPy](https://www.w3schools.com/python/scipy/scipy_exercises.php "SciPy Exercises") [Exercise](https://www.w3schools.com/python/scipy/scipy_exercises.php "SciPy Exercises") [Quiz](https://www.w3schools.com/python/scipy/scipy_quiz.php "SciPy Quizzes") [Excel](https://www.w3schools.com/excel/excel_exercises.php "Excel Exercises") [Exercise](https://www.w3schools.com/excel/excel_exercises.php "Excel Exercises") [What is an Exercise?](https://www.w3schools.com/exercises/index.php "W3Schools Exercises") [What is a Quiz?](https://www.w3schools.com/quiztest/default.asp "W3Schools Quizzes") [What is a Code Challenge?](https://www.w3schools.com/challenges/index.php "W3Schools Code Challenges") × ## **Certificates** Filter field for certifications × ### HTML and CSS [HTML](https://campus.w3schools.com/collections/certifications/products/html-certificate "HTML Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/html-certificate "HTML Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/html-course "Paid HTML Course") [Bootcamp](https://www.w3schools.com/bootcamp/html-css.php "HTML Bootcamp") [CSS](https://campus.w3schools.com/collections/certifications/products/css-certificate "CSS Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/css-certificate "CSS Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/css-course "Paid CSS Course") [Bootcamp](https://www.w3schools.com/bootcamp/html-css.php "CSS Bootcamp") [Bootstrap 3](https://campus.w3schools.com/collections/certifications/products/bootstrap-3-certificate "Bootstrap 3 Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/bootstrap-3-certificate "Bootstrap 3 Certification Exam") [Course](https://campus.w3schools.com/collections/single-courses/products/bootstrap-course "Paid Bootstrap 3 Course") [Bootstrap 4](https://campus.w3schools.com/collections/certifications/products/bootstrap-4-certificate "Bootstrap 4 Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/bootstrap-4-certificate "Bootstrap 4 Certification Exam") [Course](https://campus.w3schools.com/collections/single-courses/products/bootstrap-4-course "Paid Bootstrap 4 Course") [Bootstrap 5](https://campus.w3schools.com/collections/certifications/products/bootstrap-5-certificate "Bootstrap 5 Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/bootstrap-5-certificate "Bootstrap 5 Certification Exam") ### Data Analytics [DSA](https://campus.w3schools.com/products/dsa-certification-exam "DSA Certificate Exam") [Certificate](https://campus.w3schools.com/products/dsa-certification-exam "DSA Certificate Exam") [Data Analytics](https://campus.w3schools.com/products/data-analytics-program "Paid Data Analytics Course") [Course](https://campus.w3schools.com/products/data-analytics-program "Paid Data Analytics Course") [NumPy](https://campus.w3schools.com/products/numpy-certification-exam "NumPy Certification Exam") [Certificate](https://campus.w3schools.com/products/numpy-certification-exam "NumPy Certification Exam") [Course](https://campus.w3schools.com/products/numpy-course "Paid NumPy Course") [Pandas](https://campus.w3schools.com/products/pandas-certification-exam "Pandas Certification Exam") [Certificate](https://campus.w3schools.com/products/pandas-certification-exam "Pandas Certification Exam") [Course](https://campus.w3schools.com/products/pandas-course "Paid Pandas Course") [Excel](https://campus.w3schools.com/products/excel-certificate "Excel Certification Exam") [Certificate](https://campus.w3schools.com/products/excel-certificate "Excel Certification Exam") [Social Media](https://campus.w3schools.com/collections/course-best-sellers/products/social-media-marketing-course "Paid Social Media Course") [Course](https://campus.w3schools.com/collections/course-best-sellers/products/social-media-marketing-course "Paid Social Media Course") [What is a Certificate?](https://campus.w3schools.com/ "W3Schools Campus") [What is a Bootcamp?](https://www.w3schools.com/bootcamp/index.php "W3Schools Bootcamps") ### Programs [Full Access Best Value\!](https://campus.w3schools.com/collections/course-catalog/products/w3schools-full-access-course "Paid Full Access Course") [Front End](https://campus.w3schools.com/collections/certifications/products/front-end-course "Paid Front End Course") [Certificate](https://campus.w3schools.com/collections/certifications/products/front-end-certificate "Front End Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/front-end-course "Paid Front End Development Course") [Web Dev.](https://campus.w3schools.com/collections/certifications/products/modern-web-development-certification "Web Development Certification") [Certificate](https://campus.w3schools.com/collections/certifications/products/modern-web-development-certification "Web Development Certification") [Course](https://campus.w3schools.com/collections/course-best-sellers/products/learn-modern-web-development "Paid Web Development Course") [Web App](https://campus.w3schools.com/collections/certifications/products/web-application-development-certificates "Web Application Development Certification") [Certificate](https://campus.w3schools.com/collections/certifications/products/web-application-development-certificates "Web Application Development Certification") [Course](https://campus.w3schools.com/collections/course-best-sellers/products/web-application-development-course "Paid Web Application Course") [Web Design](https://campus.w3schools.com/collections/certifications/products/web-design-certification "Web Design Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/web-design-certification "Web Design Certification Exam") [Course](https://campus.w3schools.com/collections/course-best-sellers/products/learn-web-design "Paid Web Design Course") ### JavaScript [JavaScript](https://campus.w3schools.com/collections/certifications/products/javascript-certificate "JavaScript Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/javascript-certificate "JavaScript Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/javascript-course "Paid JavaScript Course") [Bootcamp](https://www.w3schools.com/bootcamp/javascript.php "JavaScript Bootcamp") [React](https://campus.w3schools.com/collections/certifications/products/react-js-certificate "React.js Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/react-js-certificate "React.js Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/react-js-course "Paid React.js Course") [Bootcamp](https://www.w3schools.com/bootcamp/react.php "React Bootcamp") [jQuery](https://campus.w3schools.com/collections/certifications/products/jquery-certificate "jQuery Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/jquery-certificate "jQuery Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/jquery-course "Paid jQuery Course") [Vue](https://campus.w3schools.com/products/vue-js-certification-exam "Vue Certification Exam") [Certificate](https://campus.w3schools.com/products/vue-js-certification-exam "Vue Certification Exam") ### Programs [Full Access Best Value\!](https://campus.w3schools.com/collections/course-catalog/products/w3schools-full-access-course "Paid Full Access Course") [Front End](https://campus.w3schools.com/collections/certifications/products/front-end-certificate "Front End Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/front-end-certificate "Front End Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/front-end-course "Paid Front End Development Course") [Bootcamp](https://www.w3schools.com/bootcamp/web-development.php "Front End Development Bootcamp") [Web Dev.](https://campus.w3schools.com/collections/certifications/products/modern-web-development-certification "Web Development Certification") [Certificate](https://campus.w3schools.com/collections/certifications/products/modern-web-development-certification "Web Development Certification") [Course](https://campus.w3schools.com/collections/course-best-sellers/products/learn-modern-web-development "Paid Web Development Course") [Bootcamp](https://www.w3schools.com/bootcamp/web-development.php "Web Development Bootcamp") [Web App](https://campus.w3schools.com/collections/certifications/products/web-application-development-certificates "Web Application Development Certification") [Certificate](https://campus.w3schools.com/collections/certifications/products/web-application-development-certificates "Web Application Development Certification") [Course](https://campus.w3schools.com/collections/course-best-sellers/products/web-application-development-course "Paid Web Application Course") [Web Design](https://campus.w3schools.com/collections/certifications/products/web-design-certification "Web Design Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/web-design-certification "Web Design Certification Exam") [Course](https://campus.w3schools.com/collections/course-best-sellers/products/learn-web-design "Paid Web Design Course") ### Programs [Full Access Best Value\!](https://campus.w3schools.com/collections/course-catalog/products/w3schools-full-access-course "Paid Full Access Course") [Front End](https://campus.w3schools.com/collections/certifications/products/front-end-certificate "Front End Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/front-end-certificate "Front End Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/front-end-course "Paid Front End Development Course") [Bootcamp](https://www.w3schools.com/bootcamp/web-development.php "Front End Development Bootcamp") [Web Dev.](https://campus.w3schools.com/collections/certifications/products/modern-web-development-certification "Web Development Certification") [Certificate](https://campus.w3schools.com/collections/certifications/products/modern-web-development-certification "Web Development Certification") [Course](https://campus.w3schools.com/collections/course-best-sellers/products/learn-modern-web-development "Paid Web Development Course") [Bootcamp](https://www.w3schools.com/bootcamp/web-development.php "Web Development Bootcamp") [Web App](https://campus.w3schools.com/collections/certifications/products/web-application-development-certificates "Web Application Development Certification") [Certificate](https://campus.w3schools.com/collections/certifications/products/web-application-development-certificates "Web Application Development Certification") [Course](https://campus.w3schools.com/collections/course-best-sellers/products/web-application-development-course "Paid Web Application Course") [Web Design](https://campus.w3schools.com/collections/certifications/products/web-design-certification "Web Design Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/web-design-certification "Web Design Certification Exam") [Course](https://campus.w3schools.com/collections/course-best-sellers/products/learn-web-design "Paid Web Design Course") ### Backend [Python](https://campus.w3schools.com/collections/certifications/products/python-certificate "Python Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/python-certificate "Python Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/python-course "Paid Python Course") [Bootcamp](https://www.w3schools.com/bootcamp/python.php "Python Bootcamp") [SQL](https://campus.w3schools.com/collections/certifications/products/sql-certificate "SQL Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/sql-certificate "SQL Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/sql-course "SQL Python Course") [Bootcamp](https://www.w3schools.com/bootcamp/sql.php "SQL Bootcamp") [MySQL](https://campus.w3schools.com/collections/certifications/products/mysql-certificate "MySQL Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/mysql-certificate "MySQL Certification Exam") [PHP](https://campus.w3schools.com/collections/certifications/products/php-certificate "PHP Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/php-certificate "PHP Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/php-course "Paid PHP Course") [Java](https://campus.w3schools.com/collections/certifications/products/java-certificate "Java Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/java-certificate "Java Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/java-course "Paid Java Course") [C](https://campus.w3schools.com/products/c-certification-exam "C Certification Exam") [Certificate](https://campus.w3schools.com/products/c-certification-exam "C Certification Exam") [C++](https://campus.w3schools.com/collections/certifications/products/c-certificate "C++ Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/c-certificate "C++ Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/c-course-1 "Paid C++ Course") [C\#](https://campus.w3schools.com/collections/certifications/products/c-certificate-1 "C# Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/c-certificate-1 "C# Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/c-course "Paid C# Course") [R](https://campus.w3schools.com/collections/course-catalog/products/r-course "Paid R Course") [Course](https://campus.w3schools.com/collections/course-catalog/products/r-course "Paid R Course") [Django](https://campus.w3schools.com/products/django-certification-exam "Django Certification Exam") [Certificate](https://campus.w3schools.com/products/django-certification-exam "Django Certification Exam") [NodeJS](https://campus.w3schools.com/products/nodejs-certificate "NodeJS Certification Exam") [Certificate](https://campus.w3schools.com/products/nodejs-certificate "NodeJS Certification Exam") [Bootcamp](https://www.w3schools.com/bootcamp/nodejs.php "NodeJS Bootcamp") [TypeScript](https://campus.w3schools.com/collections/certifications/products/typescript-certificate "TypeScript Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/typescript-certificate "TypeScript Certification Exam") [Course](https://campus.w3schools.com/products/learn-typescript "Paid TypeScript Course") [XML](https://campus.w3schools.com/collections/certifications/products/xml-certificate "XML Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/xml-certificate "XML Certification Exam") [Course](https://campus.w3schools.com/collections/course-catalog/products/xml-course "Paid XML Course") [Cyber Security](https://campus.w3schools.com/collections/certifications/products/cyber-security-certificate "Cyber Security Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/cyber-security-certificate "Cyber Security Certification Exam") [Course](https://campus.w3schools.com/products/cyber-security-course "Paid Cyber Security Course") [Accessibility](https://campus.w3schools.com/collections/certifications/products/accessibility-certificate "Accessibility Certification Exam") [Certificate](https://campus.w3schools.com/collections/certifications/products/accessibility-certificate "Accessibility Certification Exam") [Course](https://campus.w3schools.com/products/accessibility-course "Paid Accessibility Course") ### Data Analytics [DSA](https://campus.w3schools.com/products/dsa-certification-exam "DSA Certification Exam") [Exam](https://campus.w3schools.com/products/dsa-certification-exam "DSA Certification Exam") [Data Analytics](https://campus.w3schools.com/products/data-analytics-program "Paid Data Analytics Course") [Course](https://campus.w3schools.com/products/data-analytics-program "Paid Data Analytics Course") [NumPy](https://campus.w3schools.com/products/numpy-course "Paid NumPy Course") [Course](https://campus.w3schools.com/products/numpy-course "Paid NumPy Course") [Pandas](https://campus.w3schools.com/products/pandas-course "Paid SciPy Course") [Course](https://campus.w3schools.com/products/pandas-course "Paid SciPy Course") [Excel](https://campus.w3schools.com/products/excel-certificate "Excel Certification Exam") [Certificate](https://campus.w3schools.com/products/excel-certificate "Excel Certification Exam") [Social Media](https://campus.w3schools.com/collections/course-best-sellers/products/social-media-marketing-course "Paid Social Media Course") [Course](https://campus.w3schools.com/collections/course-best-sellers/products/social-media-marketing-course "Paid Social Media Course") [What is a Certificate?](https://campus.w3schools.com/ "W3Schools Campus") × ## **All Our Services** Dark mode  Services filter input × W3Schools offers a wide range of services and products for beginners and professionals, helping millions of people everyday to learn and master new skills. [Free Tutorials Enjoy our free tutorials like millions of other internet users since 1999](https://www.w3schools.com/tutorials/index.php "Tutorials") [References Explore our selection of references covering all popular coding languages](https://www.w3schools.com/references/index.php "References") [Create a Website Create your own website with **W3Schools Spaces** - no setup required](https://www.w3schools.com/spaces/index.php "Create a Website") [Exercises Test your skills with different exercises](https://www.w3schools.com/exercises/index.php "Test yourself with exercises") [Quizzes Test yourself with multiple choice questions](https://www.w3schools.com/quiztest/default.asp "Test yourself with quizzes") [Code Challenges Test your skills with interactive code challenges](https://www.w3schools.com/challenges/index.php "Test yourself with Code Challenges") [Get Certified Document your knowledge](https://campus.w3schools.com/collections/certifications "Certificates") [Log in / Sign Up Create an account to track your progress](https://profile.w3schools.com/sign-up?redirect_url=https%3A%2F%2Fwww.w3schools.com%2Fhowto%2Fhowto_js_add_class.asp "Log in our Sign up") [League Earn XP and climb the ranks with different challenges](https://www.w3schools.com/league/ "Earn XP and climb the ranks with our League") [Upgrade Become a PLUS user and unlock powerful features (ad-free, hosting, support,..)](https://order.w3schools.com/plans "Upgrade subscription") [Where To Start Not sure where you want to start? Follow our guided path](https://www.w3schools.com/where_to_start.asp "Where To Start") [Code Editor (Try it) With our online code editor, you can edit code and view the result in your browser](https://www.w3schools.com/tryit/default.asp "W3Schools Code Editor") [Bootcamps Learn from passionate instructors through live online sessions](https://www.w3schools.com/bootcamp/index.php "W3Schools Bootcamps") [Templates We have created a bunch of responsive website templates you can use - for free\!](https://www.w3schools.com/w3css/w3css_templates.asp "Free Web Templates") [Web Hosting Host your own website, and share it to the world with **W3Schools Spaces**](https://www.w3schools.com/spaces/index.php "Web Hosting with Spaces") [Create a Server Create your own server using Python, PHP, React.js, Node.js, Java, C\#, etc.](https://www.w3schools.com/spaces/index.php "Get your own server") [How To's Large collection of code snippets for HTML, CSS and JavaScript](https://www.w3schools.com/howto/default.asp "How To Collection") [CSS Framework Build fast and responsive sites using our free **W3.CSS** framework](https://www.w3schools.com/w3css/default.asp "W3.CSS Framework") [Videos Learn the basics of HTML in a fun and engaging video tutorial](https://www.w3schools.com/videos/index.php "HTML Video Tutorial") [Browser Statistics Read long term trends of browser usage](https://www.w3schools.com/browsers/default.asp "Browser Statistics") [Typing Speed Test your typing speed](https://www.w3schools.com/typingspeed/default.asp "Test Your Typing speed") [Color Picker Use our color picker to find different RGB, HEX and HSL colors. ![A circular color wheel showing the gradation of colors in the spectrum](https://www.w3schools.com/images/colorpicker2000.png)](https://www.w3schools.com/colors/colors_picker.asp "Color Picker") [Newsletter Join our newsletter and get access to exclusive content every month](https://campus.w3schools.com/pages/newsletter "Join Our Newsletter") [Emojis Reference Check out our refererence page with all the emojis supported in HTML 😊](https://www.w3schools.com/charsets/ref_emoji_intro.asp "Emojis Reference") [Code Game W3Schools Coding Game! Help the lynx collect pine cones ![Lynx logo](https://www.w3schools.com/signup/lynxlogo.svg)](https://www.w3schools.com/codegame/index.html "Coding Game") [UTF-8 Reference Check out our full UTF-8 Character reference](https://www.w3schools.com/charsets/default.asp "UTF-8 Reference") [Community Chat, Learn and Connect with Us on Discord](https://discord.com/invite/w3schools "W3Schools Community") [Teachers Contact us about W3Schools Academy for educational institutions](https://www.w3schools.com/academy/index.php "W3Schools Academy / Classroom") [For Businesses Contact us about W3Schools Academy for your organization](https://www.w3schools.com/academy/index.php "W3Schools Academy / Classroom") #### Contact Us About sales: sales@w3schools.com About errors: help@w3schools.com [Web Developer Tools Free online tools to help with your everyday development tasks](https://www.w3schools.com/tools/index.php "Web Developer Tools") [**](https://www.linkedin.com/company/w3schools.com/ "W3Schools on LinkedIn") [**](https://discord.com/invite/w3schools "Join the W3schools community on Discord") [**](https://www.facebook.com/w3schoolscom/ "W3Schools on Facebook") [**](https://www.instagram.com/w3schools.com_official/ "W3Schools on Instagram") × ❮ ❯ [HTML](https://www.w3schools.com/html/default.asp "HTML Tutorial") [CSS](https://www.w3schools.com/css/default.asp "CSS Tutorial") [JAVASCRIPT](https://www.w3schools.com/js/default.asp "JavaScript Tutorial") [SQL](https://www.w3schools.com/sql/default.asp "SQL Tutorial") [PYTHON](https://www.w3schools.com/python/default.asp "Python Tutorial") [JAVA](https://www.w3schools.com/java/default.asp "Java Tutorial") [PHP](https://www.w3schools.com/php/default.asp "PHP Tutorial") [HOW TO](https://www.w3schools.com/howto/default.asp "How to") [W3.CSS](https://www.w3schools.com/w3css/default.asp "W3.CSS Tutorial") [C](https://www.w3schools.com/c/index.php "C Tutorial") [C++](https://www.w3schools.com/cpp/default.asp "C++ Tutorial") [C\#](https://www.w3schools.com/cs/index.php "C# Tutorial") [BOOTSTRAP](https://www.w3schools.com/bootstrap/bootstrap_ver.asp "Bootstrap Tutorial") [REACT](https://www.w3schools.com/react/default.asp "React Tutorial") [MYSQL](https://www.w3schools.com/mysql/default.asp "MySQL Tutorial") [JQUERY](https://www.w3schools.com/jquery/default.asp "JQuery Tutorial") [EXCEL](https://www.w3schools.com/excel/index.php "Excel Tutorial") [XML](https://www.w3schools.com/xml/default.asp "XML Tutorial") [DJANGO](https://www.w3schools.com/django/index.php "Django Tutorial") [NUMPY](https://www.w3schools.com/python/numpy/default.asp "NumPy Tutorial") [PANDAS](https://www.w3schools.com/python/pandas/default.asp "Pandas Tutorial") [NODEJS](https://www.w3schools.com/nodejs/default.asp "Node.js Tutorial") [DSA](https://www.w3schools.com/dsa/index.php "DSA Tutorial") [TYPESCRIPT](https://www.w3schools.com/typescript/index.php "TypeScript Tutorial") [ANGULAR](https://www.w3schools.com/angular/default.asp "Angular Tutorial") [ANGULARJS](https://www.w3schools.com/angularjs/default.asp "Angular.js Tutorial") [GIT](https://www.w3schools.com/git/default.asp "Git Tutorial") [POSTGRESQL](https://www.w3schools.com/postgresql/index.php "PostgreSQL Tutorial") [MONGODB](https://www.w3schools.com/mongodb/index.php "MongoDB Tutorial") [ASP](https://www.w3schools.com/asp/default.asp "ASP Tutorial") [AI](https://www.w3schools.com/ai/default.asp "A.I. Tutorial") [R](https://www.w3schools.com/r/default.asp "R Tutorial") [GO](https://www.w3schools.com/go/index.php "Go Tutorial") [KOTLIN](https://www.w3schools.com/kotlin/index.php "Kotlin Tutorial") [SWIFT](https://www.w3schools.com/swift/default.asp "Swift Tutorial") [SASS](https://www.w3schools.com/sass/default.asp "Sass Tutorial") [VUE](https://www.w3schools.com/vue/index.php "Vue.js Tutorial") [GEN AI](https://www.w3schools.com/gen_ai/index.php "Gen A.I. Tutorial") [SCIPY](https://www.w3schools.com/python/scipy/index.php "SciPy Tutorial") [AWS](https://www.w3schools.com/aws/index.php "AWS Tutorial") [CYBERSECURITY](https://www.w3schools.com/cybersecurity/index.php "Cyber security Tutorial") [DATA SCIENCE](https://www.w3schools.com/datascience/default.asp "Data science Tutorial") [INTRO TO PROGRAMMING](https://www.w3schools.com/programming/index.php "Introduction to Programming") [INTRO TO HTML & CSS](https://www.w3schools.com/htmlcss/default.asp "Introduction to HTML & CSS") [BASH](https://www.w3schools.com/bash/index.php "Bash Tutorial") [RUST](https://www.w3schools.com/rust/index.php "Rust Tutorial") [TOOLS](https://www.w3schools.com/tools/index.php "Web Developer Tools") ## HOW TO [HowTo Home](https://www.w3schools.com/howto/default.asp) ## Menus [Icon Bar](https://www.w3schools.com/howto/howto_css_icon_bar.asp) [Menu Icon](https://www.w3schools.com/howto/howto_css_menu_icon.asp) [Accordion](https://www.w3schools.com/howto/howto_js_accordion.asp) [Tabs](https://www.w3schools.com/howto/howto_js_tabs.asp) [Vertical Tabs](https://www.w3schools.com/howto/howto_js_vertical_tabs.asp) [Tab Headers](https://www.w3schools.com/howto/howto_js_tab_header.asp) [Full Page Tabs](https://www.w3schools.com/howto/howto_js_full_page_tabs.asp) [Hover Tabs](https://www.w3schools.com/howto/howto_js_hover_tabs.asp) [Top Navigation](https://www.w3schools.com/howto/howto_js_topnav.asp) [Responsive Topnav](https://www.w3schools.com/howto/howto_js_topnav_responsive.asp) [Split Navigation](https://www.w3schools.com/howto/howto_css_topnav_split.asp) [Navbar with Icons](https://www.w3schools.com/howto/howto_css_navbar_icon.asp) [Search Menu](https://www.w3schools.com/howto/howto_js_search_menu.asp) [Search Bar](https://www.w3schools.com/howto/howto_css_searchbar.asp) [Fixed Sidebar](https://www.w3schools.com/howto/howto_css_fixed_sidebar.asp) [Side Navigation](https://www.w3schools.com/howto/howto_js_sidenav.asp) [Responsive Sidebar](https://www.w3schools.com/howto/howto_css_sidebar_responsive.asp) [Fullscreen Navigation](https://www.w3schools.com/howto/howto_js_fullscreen_overlay.asp) [Off-Canvas Menu](https://www.w3schools.com/howto/howto_js_off-canvas.asp) [Hover Sidenav Buttons](https://www.w3schools.com/howto/howto_css_sidenav_buttons.asp) [Sidebar with Icons](https://www.w3schools.com/howto/howto_css_sidebar_icons.asp) [Horizontal Scroll Menu](https://www.w3schools.com/howto/howto_css_menu_horizontal_scroll.asp) [Vertical Menu](https://www.w3schools.com/howto/howto_css_vertical_menu.asp) [Bottom Navigation](https://www.w3schools.com/howto/howto_css_bottom_nav.asp) [Responsive Bottom Nav](https://www.w3schools.com/howto/howto_js_bottom_nav_responsive.asp) [Bottom Border Nav Links](https://www.w3schools.com/howto/howto_css_navbar_border.asp) [Right Aligned Menu Links](https://www.w3schools.com/howto/howto_css_topnav_right.asp) [Centered Menu Link](https://www.w3schools.com/howto/howto_css_topnav_centered.asp) [Equal Width Menu Links](https://www.w3schools.com/howto/howto_css_topnav_equal_width.asp) [Fixed Menu](https://www.w3schools.com/howto/howto_css_fixed_menu.asp) [Slide Down Bar on Scroll](https://www.w3schools.com/howto/howto_js_navbar_slide.asp) [Hide Navbar on Scroll](https://www.w3schools.com/howto/howto_js_navbar_hide_scroll.asp) [Shrink Navbar on Scroll](https://www.w3schools.com/howto/howto_js_navbar_shrink_scroll.asp) [Sticky Navbar](https://www.w3schools.com/howto/howto_js_navbar_sticky.asp) [Navbar on Image](https://www.w3schools.com/howto/howto_css_navbar_image.asp) [Hover Dropdowns](https://www.w3schools.com/howto/howto_css_dropdown.asp) [Click Dropdowns](https://www.w3schools.com/howto/howto_js_dropdown.asp) [Cascading Dropdown](https://www.w3schools.com/howto/howto_js_cascading_dropdown.asp) [Dropdown in Topnav](https://www.w3schools.com/howto/howto_css_dropdown_navbar.asp) [Dropdown in Sidenav](https://www.w3schools.com/howto/howto_js_dropdown_sidenav.asp) [Resp Navbar Dropdown](https://www.w3schools.com/howto/howto_js_responsive_navbar_dropdown.asp) [Subnavigation Menu](https://www.w3schools.com/howto/howto_css_subnav.asp) [Dropup](https://www.w3schools.com/howto/howto_css_dropup.asp) [Mega Menu](https://www.w3schools.com/howto/howto_css_mega_menu.asp) [Mobile Menu](https://www.w3schools.com/howto/howto_js_mobile_navbar.asp) [Curtain Menu](https://www.w3schools.com/howto/howto_js_curtain_menu.asp) [Collapsed Sidebar](https://www.w3schools.com/howto/howto_js_collapse_sidebar.asp) [Collapsed Sidepanel](https://www.w3schools.com/howto/howto_js_collapse_sidepanel.asp) [Pagination](https://www.w3schools.com/howto/howto_css_pagination.asp) [Breadcrumbs](https://www.w3schools.com/howto/howto_css_breadcrumbs.asp) [Button Group](https://www.w3schools.com/howto/howto_css_button_group.asp) [Vertical Button Group](https://www.w3schools.com/howto/howto_css_button_group_vertical.asp) [Sticky Social Bar](https://www.w3schools.com/howto/howto_css_sticky_social_bar.asp) [Pill Navigation](https://www.w3schools.com/howto/howto_css_pill_nav.asp) [Responsive Header](https://www.w3schools.com/howto/howto_css_responsive_header.asp) ## Images [Slideshow](https://www.w3schools.com/howto/howto_js_slideshow.asp) [Slideshow Gallery](https://www.w3schools.com/howto/howto_js_slideshow_gallery.asp) [Modal Images](https://www.w3schools.com/howto/howto_css_modal_images.asp) [Lightbox](https://www.w3schools.com/howto/howto_js_lightbox.asp) [Responsive Image Grid](https://www.w3schools.com/howto/howto_css_image_grid_responsive.asp) [Image Grid](https://www.w3schools.com/howto/howto_js_image_grid.asp) [Image Gallery](https://www.w3schools.com/howto/howto_css_image_gallery.asp) [Scrollable Image Gallery](https://www.w3schools.com/howto/howto_css_image_gallery_scroll.asp) [Tab Gallery](https://www.w3schools.com/howto/howto_js_tab_img_gallery.asp) [Image Overlay Fade](https://www.w3schools.com/howto/howto_css_image_overlay.asp) [Image Overlay Slide](https://www.w3schools.com/howto/howto_css_image_overlay_slide.asp) [Image Overlay Zoom](https://www.w3schools.com/howto/howto_css_image_overlay_zoom.asp) [Image Overlay Title](https://www.w3schools.com/howto/howto_css_image_overlay_title.asp) [Image Overlay Icon](https://www.w3schools.com/howto/howto_css_image_overlay_icon.asp) [Image Effects](https://www.w3schools.com/howto/howto_css_image_effects.asp) [Black and White Image](https://www.w3schools.com/howto/howto_css_image_bw.asp) [Image Text](https://www.w3schools.com/howto/howto_css_image_text.asp) [Image Text Blocks](https://www.w3schools.com/howto/howto_css_image_text_blocks.asp) [Transparent Image Text](https://www.w3schools.com/howto/howto_css_image_transparent.asp) [Full Page Image](https://www.w3schools.com/howto/howto_css_full_page.asp) [Form on Image](https://www.w3schools.com/howto/howto_css_form_on_image.asp) [Hero Image](https://www.w3schools.com/howto/howto_css_hero_image.asp) [Blur Background Image](https://www.w3schools.com/howto/howto_css_blurred_background.asp) [Change Bg on Scroll](https://www.w3schools.com/howto/howto_css_bg_change_scroll.asp) [Side-by-Side Images](https://www.w3schools.com/howto/howto_css_images_side_by_side.asp) [Rounded Images](https://www.w3schools.com/howto/howto_css_rounded_images.asp) [Avatar Images](https://www.w3schools.com/howto/howto_css_image_avatar.asp) [Responsive Images](https://www.w3schools.com/howto/howto_css_image_responsive.asp) [Center Images](https://www.w3schools.com/howto/howto_css_image_center.asp) [Thumbnails](https://www.w3schools.com/howto/howto_css_thumbnail.asp) [Border Around Image](https://www.w3schools.com/howto/howto_css_border_image.asp) [Meet the Team](https://www.w3schools.com/howto/howto_css_team.asp) [Sticky Image](https://www.w3schools.com/howto/howto_css_image_sticky.asp) [Flip an Image](https://www.w3schools.com/howto/howto_css_flip_image.asp) [Shake an Image](https://www.w3schools.com/howto/howto_css_shake_image.asp) [Portfolio Gallery](https://www.w3schools.com/howto/howto_css_portfolio_gallery.asp) [Portfolio with Filtering](https://www.w3schools.com/howto/howto_js_portfolio_filter.asp) [Image Zoom](https://www.w3schools.com/howto/howto_js_image_zoom.asp) [Image Magnifier Glass](https://www.w3schools.com/howto/howto_js_image_magnifier_glass.asp) [Image Comparison Slider](https://www.w3schools.com/howto/howto_js_image_comparison.asp) [Favicon](https://www.w3schools.com/howto/howto_html_favicon.asp) ## Buttons [Alert Buttons](https://www.w3schools.com/howto/howto_css_alert_buttons.asp) [Outline Buttons](https://www.w3schools.com/howto/howto_css_outline_buttons.asp) [Split Buttons](https://www.w3schools.com/howto/howto_css_button_split.asp) [Animated Buttons](https://www.w3schools.com/howto/howto_css_animate_buttons.asp) [Fading Buttons](https://www.w3schools.com/howto/howto_css_fading_buttons.asp) [Button on Image](https://www.w3schools.com/howto/howto_css_button_on_image.asp) [Social Media Buttons](https://www.w3schools.com/howto/howto_css_social_media_buttons.asp) [Read More Read Less](https://www.w3schools.com/howto/howto_js_read_more.asp) [Loading Buttons](https://www.w3schools.com/howto/howto_css_loading_buttons.asp) [Download Buttons](https://www.w3schools.com/howto/howto_css_download_button.asp) [Pill Buttons](https://www.w3schools.com/howto/howto_css_pill_button.asp) [Notification Button](https://www.w3schools.com/howto/howto_css_notification_button.asp) [Icon Buttons](https://www.w3schools.com/howto/howto_css_icon_buttons.asp) [Next/prev Buttons](https://www.w3schools.com/howto/howto_css_next_prev.asp) [More Button in Nav](https://www.w3schools.com/howto/howto_css_more_button.asp) [Block Buttons](https://www.w3schools.com/howto/howto_css_block_buttons.asp) [Text Buttons](https://www.w3schools.com/howto/howto_css_text_buttons.asp) [Round Buttons](https://www.w3schools.com/howto/howto_css_round_buttons.asp) [Scroll To Top Button](https://www.w3schools.com/howto/howto_js_scroll_to_top.asp) ## Forms [Login Form](https://www.w3schools.com/howto/howto_css_login_form.asp) [Signup Form](https://www.w3schools.com/howto/howto_css_signup_form.asp) [Checkout Form](https://www.w3schools.com/howto/howto_css_checkout_form.asp) [Contact Form](https://www.w3schools.com/howto/howto_css_contact_form.asp) [Social Login Form](https://www.w3schools.com/howto/howto_css_social_login.asp) [Register Form](https://www.w3schools.com/howto/howto_css_register_form.asp) [Form with Icons](https://www.w3schools.com/howto/howto_css_form_icon.asp) [Newsletter](https://www.w3schools.com/howto/howto_css_newsletter.asp) [Stacked Form](https://www.w3schools.com/howto/howto_css_stacked_form.asp) [Responsive Form](https://www.w3schools.com/howto/howto_css_responsive_form.asp) [Popup Form](https://www.w3schools.com/howto/howto_js_popup_form.asp) [Inline Form](https://www.w3schools.com/howto/howto_css_inline_form.asp) [Clear Input Field](https://www.w3schools.com/howto/howto_html_clear_input.asp) [Hide Number Arrows](https://www.w3schools.com/howto/howto_css_hide_arrow_number.asp) [Copy Text to Clipboard](https://www.w3schools.com/howto/howto_js_copy_clipboard.asp) [Animated Search](https://www.w3schools.com/howto/howto_css_animated_search.asp) [Search Button](https://www.w3schools.com/howto/howto_css_search_button.asp) [Fullscreen Search](https://www.w3schools.com/howto/howto_css_fullscreen_search.asp) [Input Field in Navbar](https://www.w3schools.com/howto/howto_css_input_navbar.asp) [Login Form in Navbar](https://www.w3schools.com/howto/howto_css_login_form_navbar.asp) [Custom Checkbox/Radio](https://www.w3schools.com/howto/howto_css_custom_checkbox.asp) [Custom Select](https://www.w3schools.com/howto/howto_custom_select.asp) [Toggle Switch](https://www.w3schools.com/howto/howto_css_switch.asp) [Check Checkbox](https://www.w3schools.com/howto/howto_js_display_checkbox_text.asp) [Detect Caps Lock](https://www.w3schools.com/howto/howto_js_detect_capslock.asp) [Trigger Button on Enter](https://www.w3schools.com/howto/howto_js_trigger_button_enter.asp) [Password Validation](https://www.w3schools.com/howto/howto_js_password_validation.asp) [Toggle Password Visibility](https://www.w3schools.com/howto/howto_js_toggle_password.asp) [Multiple Step Form](https://www.w3schools.com/howto/howto_js_form_steps.asp) [Autocomplete](https://www.w3schools.com/howto/howto_js_autocomplete.asp) [Turn off autocomplete](https://www.w3schools.com/howto/howto_html_autocomplete_off.asp) [Turn off spellcheck](https://www.w3schools.com/howto/howto_html_spellcheck_disable.asp) [File Upload Button](https://www.w3schools.com/howto/howto_html_file_upload_button.asp) [Empty Input Validation](https://www.w3schools.com/howto/howto_js_validation_empty_input.asp) ## Filters [Filter List](https://www.w3schools.com/howto/howto_js_filter_lists.asp) [Filter Table](https://www.w3schools.com/howto/howto_js_filter_table.asp) [Filter Elements](https://www.w3schools.com/howto/howto_js_filter_elements.asp) [Filter Dropdown](https://www.w3schools.com/howto/howto_js_filter_dropdown.asp) [Sort List](https://www.w3schools.com/howto/howto_js_sort_list.asp) [Sort Table](https://www.w3schools.com/howto/howto_js_sort_table.asp) ## Tables [Zebra Striped Table](https://www.w3schools.com/howto/howto_css_table_zebra.asp) [Center Tables](https://www.w3schools.com/howto/howto_css_table_center.asp) [Full-width Table](https://www.w3schools.com/howto/howto_css_table_full_width.asp) [Nested Table](https://www.w3schools.com/howto/howto_html_table_nested.asp) [Side-by-side Tables](https://www.w3schools.com/howto/howto_css_table_side_by_side.asp) [Responsive Tables](https://www.w3schools.com/howto/howto_css_table_responsive.asp) [Comparison Table](https://www.w3schools.com/howto/howto_css_comparison_table.asp) ## More [Fullscreen Video](https://www.w3schools.com/howto/howto_css_fullscreen_video.asp) [Modal Boxes](https://www.w3schools.com/howto/howto_css_modals.asp) [Delete Modal](https://www.w3schools.com/howto/howto_css_delete_modal.asp) [Timeline](https://www.w3schools.com/howto/howto_css_timeline.asp) [Scroll Indicator](https://www.w3schools.com/howto/howto_js_scroll_indicator.asp) [Progress Bars](https://www.w3schools.com/howto/howto_js_progressbar.asp) [Skill Bar](https://www.w3schools.com/howto/howto_css_skill_bar.asp) [Range Sliders](https://www.w3schools.com/howto/howto_js_rangeslider.asp) [Color Picker](https://www.w3schools.com/howto/howto_html_colorpicker.asp) [Email Field](https://www.w3schools.com/howto/howto_html_email_field.asp) [Tooltips](https://www.w3schools.com/howto/howto_css_tooltip.asp) [Display Element Hover](https://www.w3schools.com/howto/howto_css_display_element_hover.asp) [Popups](https://www.w3schools.com/howto/howto_js_popup.asp) [Collapsible](https://www.w3schools.com/howto/howto_js_collapsible.asp) [Calendar](https://www.w3schools.com/howto/howto_css_calendar.asp) [HTML Includes](https://www.w3schools.com/howto/howto_html_include.asp) [To Do List](https://www.w3schools.com/howto/howto_js_todolist.asp) [Loaders](https://www.w3schools.com/howto/howto_css_loader.asp) [Badges](https://www.w3schools.com/howto/howto_css_badge.asp) [Star Rating](https://www.w3schools.com/howto/howto_css_star_rating.asp) [User Rating](https://www.w3schools.com/howto/howto_css_user_rating.asp) [Overlay Effect](https://www.w3schools.com/howto/howto_css_overlay.asp) [Contact Chips](https://www.w3schools.com/howto/howto_css_contact_chips.asp) [Cards](https://www.w3schools.com/howto/howto_css_cards.asp) [Flip Card](https://www.w3schools.com/howto/howto_css_flip_card.asp) [Profile Card](https://www.w3schools.com/howto/howto_css_profile_card.asp) [Product Card](https://www.w3schools.com/howto/howto_css_product_card.asp) [Alerts](https://www.w3schools.com/howto/howto_js_alert.asp) [Callout](https://www.w3schools.com/howto/howto_js_callout.asp) [Notes](https://www.w3schools.com/howto/howto_css_notes.asp) [Labels](https://www.w3schools.com/howto/howto_css_labels.asp) [Ribbon](https://www.w3schools.com/howto/howto_css_ribbon.asp) [Tag Cloud](https://www.w3schools.com/howto/howto_css_tag_cloud.asp) [Circles](https://www.w3schools.com/howto/howto_css_circles.asp) [Style HR](https://www.w3schools.com/howto/howto_css_style_hr.asp) [Coupon](https://www.w3schools.com/howto/howto_css_coupon.asp) [List Group](https://www.w3schools.com/howto/howto_css_list_group.asp) [List Group with Badges](https://www.w3schools.com/howto/howto_css_list_group_badges.asp) [List Without Bullets](https://www.w3schools.com/howto/howto_css_list_without_bullets.asp) [Responsive Text](https://www.w3schools.com/howto/howto_css_responsive_text.asp) [Cutout Text](https://www.w3schools.com/howto/howto_css_cutout_text.asp) [Glowing Text](https://www.w3schools.com/howto/howto_css_glowing_text.asp) [Fixed Footer](https://www.w3schools.com/howto/howto_css_fixed_footer.asp) [Sticky Element](https://www.w3schools.com/howto/howto_css_sticky_element.asp) [Equal Height](https://www.w3schools.com/howto/howto_css_equal_height.asp) [Clearfix](https://www.w3schools.com/howto/howto_css_clearfix.asp) [Responsive Floats](https://www.w3schools.com/howto/howto_css_responsive_floats.asp) [Snackbar](https://www.w3schools.com/howto/howto_js_snackbar.asp) [Fullscreen Window](https://www.w3schools.com/howto/howto_js_fullscreen.asp) [Scroll Drawing](https://www.w3schools.com/howto/howto_js_scrolldrawing.asp) [Smooth Scroll](https://www.w3schools.com/howto/howto_css_smooth_scroll.asp) [Gradient Bg Scroll](https://www.w3schools.com/howto/howto_css_bg_gradient_scroll.asp) [Sticky Header](https://www.w3schools.com/howto/howto_js_sticky_header.asp) [Shrink Header on Scroll](https://www.w3schools.com/howto/howto_js_shrink_header_scroll.asp) [Pricing Table](https://www.w3schools.com/howto/howto_css_pricing_table.asp) [Parallax](https://www.w3schools.com/howto/howto_css_parallax.asp) [Aspect Ratio](https://www.w3schools.com/howto/howto_css_aspect_ratio.asp) [Responsive Iframes](https://www.w3schools.com/howto/howto_css_responsive_iframes.asp) [Toggle Like/Dislike](https://www.w3schools.com/howto/howto_js_toggle_like.asp) [Toggle Hide/Show](https://www.w3schools.com/howto/howto_js_toggle_hide_show.asp) [Toggle Dark Mode](https://www.w3schools.com/howto/howto_js_toggle_dark_mode.asp) [Toggle Text](https://www.w3schools.com/howto/howto_js_toggle_text.asp) [Toggle Class](https://www.w3schools.com/howto/howto_js_toggle_class.asp) [Add Class](https://www.w3schools.com/howto/howto_js_add_class.asp) [Remove Class](https://www.w3schools.com/howto/howto_js_remove_class.asp) [Change Class](https://www.w3schools.com/howto/howto_js_change_class.asp) [Active Class](https://www.w3schools.com/howto/howto_js_active_element.asp) [Tree View](https://www.w3schools.com/howto/howto_js_treeview.asp) [Remove Decimals](https://www.w3schools.com/howto/howto_js_remove_decimals.asp) [Remove Property](https://www.w3schools.com/howto/howto_js_remove_property_object.asp) [Offline Detection](https://www.w3schools.com/howto/howto_js_offline_detection.asp) [Find Hidden Element](https://www.w3schools.com/howto/howto_js_check_hidden.asp) [Redirect Webpage](https://www.w3schools.com/howto/howto_js_redirect_webpage.asp) [Format a Number](https://www.w3schools.com/howto/howto_js_format_number_dec.asp) [Zoom Hover](https://www.w3schools.com/howto/howto_css_zoom_hover.asp) [Flip Box](https://www.w3schools.com/howto/howto_css_flip_box.asp) [Center Vertically](https://www.w3schools.com/howto/howto_css_center-vertical.asp) [Center Button in DIV](https://www.w3schools.com/howto/howto_css_center_button.asp) [Center a List](https://www.w3schools.com/howto/howto_css_center-list.asp) [Transition on Hover](https://www.w3schools.com/howto/howto_css_transition_hover.asp) [Arrows](https://www.w3schools.com/howto/howto_css_arrows.asp) [Shapes](https://www.w3schools.com/howto/howto_css_shapes.asp) [Download Link](https://www.w3schools.com/howto/howto_html_download_link.asp) [Full Height Element](https://www.w3schools.com/howto/howto_css_div_full_height.asp) [Browser Window](https://www.w3schools.com/howto/howto_css_browser_window.asp) [Custom Scrollbar](https://www.w3schools.com/howto/howto_css_custom_scrollbar.asp) [Hide Scrollbar](https://www.w3schools.com/howto/howto_css_hide_scrollbars.asp) [Show/Force Scrollbar](https://www.w3schools.com/howto/howto_css_force_scrollbars.asp) [Device Look](https://www.w3schools.com/howto/howto_css_devices.asp) [Contenteditable Border](https://www.w3schools.com/howto/howto_css_contenteditable_border.asp) [Placeholder Color](https://www.w3schools.com/howto/howto_css_placeholder.asp) [Disable Resizing of Textarea](https://www.w3schools.com/howto/howto_css_disable_resize_textarea.asp) [Disable Text Selection](https://www.w3schools.com/howto/howto_css_disable_text_selection.asp) [Text Selection Color](https://www.w3schools.com/howto/howto_css_text_selection.asp) [Bullet Color](https://www.w3schools.com/howto/howto_css_bullet_color.asp) [Vertical Line](https://www.w3schools.com/howto/howto_css_vertical_line.asp) [Dividers](https://www.w3schools.com/howto/howto_css_dividers.asp) [Text Divider](https://www.w3schools.com/howto/howto_css_text_divider.asp) [Animate Icons](https://www.w3schools.com/howto/howto_js_animate_icons.asp) [Countdown Timer](https://www.w3schools.com/howto/howto_js_countdown.asp) [Typewriter](https://www.w3schools.com/howto/howto_js_typewriter.asp) [Coming Soon Page](https://www.w3schools.com/howto/howto_css_coming_soon.asp) [Chat Messages](https://www.w3schools.com/howto/howto_css_chat.asp) [Popup Chat Window](https://www.w3schools.com/howto/howto_js_popup_chat.asp) [Split Screen](https://www.w3schools.com/howto/howto_css_split_screen.asp) [Testimonials](https://www.w3schools.com/howto/howto_css_testimonials.asp) [Section Counter](https://www.w3schools.com/howto/howto_css_section_counter.asp) [Quotes Slideshow](https://www.w3schools.com/howto/howto_js_quotes_slideshow.asp) [Closable List Items](https://www.w3schools.com/howto/howto_js_close_list_items.asp) [Typical Device Breakpoints](https://www.w3schools.com/howto/howto_css_media_query_breakpoints.asp) [Draggable HTML Element](https://www.w3schools.com/howto/howto_js_draggable.asp) [JS Media Queries](https://www.w3schools.com/howto/howto_js_media_queries.asp) [Syntax Highlighter](https://www.w3schools.com/howto/howto_syntax_highlight.asp) [JS Animations](https://www.w3schools.com/howto/howto_js_animate.asp) [JS String Length](https://www.w3schools.com/howto/howto_js_string_length.asp) [JS Exponentiation](https://www.w3schools.com/howto/howto_js_exponentiation.asp) [JS Default Parameters](https://www.w3schools.com/howto/howto_js_default_parameters.asp) [JS Random Number](https://www.w3schools.com/howto/howto_js_random_number_two_nums.asp) [JS Sort Numeric Array](https://www.w3schools.com/howto/howto_js_sort_numeric_array.asp) [JS Spread Operator](https://www.w3schools.com/howto/howto_js_spread_operator.asp) [JS Scroll Into View](https://www.w3schools.com/howto/howto_js_scroll_into_view.asp) [Get Current Date](https://www.w3schools.com/howto/howto_js_get_date.asp) [Get Current URL](https://www.w3schools.com/howto/howto_js_get_url.asp) [Get Current Screen Size](https://www.w3schools.com/howto/howto_js_get_current_window.asp) [Get Iframe Elements](https://www.w3schools.com/howto/howto_js_element_iframe.asp) ## Website [Create a Website](https://www.w3schools.com/howto/howto_website_create_website.asp) [Make a Website](https://www.w3schools.com/howto/howto_make_a_website.asp) [Make a Static Website](https://www.w3schools.com/howto/howto_website_static.asp) [Host a Static Website](https://www.w3schools.com/howto/howto_website_host_staticwebsite.asp) [Make a Website (W3.CSS)](https://www.w3schools.com/howto/howto_website.asp) [Make a Website (BS3)](https://www.w3schools.com/howto/howto_website_bootstrap.asp) [Make a Website (BS4)](https://www.w3schools.com/howto/howto_website_bootstrap4.asp) [Make a Website (BS5)](https://www.w3schools.com/howto/howto_website_bootstrap5.asp) [Create and View a Website](https://www.w3schools.com/howto/howto_create_and_view.asp) [Create a Link Tree Website](https://www.w3schools.com/howto/howto_website_create_linktree.asp) [Create a Portfolio](https://www.w3schools.com/howto/howto_website_create_portfolio.asp) [Create a Resume](https://www.w3schools.com/howto/howto_website_create_resume.asp) [Make a Restaurant Website](https://www.w3schools.com/howto/howto_website_restaurant.asp) [Make a Business Website](https://www.w3schools.com/howto/howto_website_business.asp) [Make a WebBook](https://www.w3schools.com/howto/howto_make_a_webbook.asp) [Center Website](https://www.w3schools.com/howto/howto_css_center_website.asp) [Contact Section](https://www.w3schools.com/howto/howto_css_contact_section.asp) [About Page](https://www.w3schools.com/howto/howto_css_about_page.asp) [Big Header](https://www.w3schools.com/howto/howto_css_style_header.asp) [Example Website](https://www.w3schools.com/howto/howto_css_example_website.asp) ## Grid [2 Column Layout](https://www.w3schools.com/howto/howto_css_two_columns.asp) [3 Column Layout](https://www.w3schools.com/howto/howto_css_three_columns.asp) [4 Column Layout](https://www.w3schools.com/howto/howto_css_four_columns.asp) [Expanding Grid](https://www.w3schools.com/howto/howto_js_expanding_grid.asp) [List Grid View](https://www.w3schools.com/howto/howto_js_list_grid_view.asp) [Mixed Column Layout](https://www.w3schools.com/howto/howto_css_mixed_columns.asp) [Column Cards](https://www.w3schools.com/howto/howto_css_column_cards.asp) [Zig Zag Layout](https://www.w3schools.com/howto/howto_css_zig_zag_layout.asp) [Blog Layout](https://www.w3schools.com/howto/howto_css_blog_layout.asp) ## Google [Google Charts](https://www.w3schools.com/howto/howto_google_charts.asp) [Google Fonts](https://www.w3schools.com/howto/howto_google_fonts.asp) [Google Font Pairings](https://www.w3schools.com/howto/howto_google_fonts_pairings.asp) [Google Set up Analytics](https://www.w3schools.com/howto/howto_google_analytics.asp) ## Converters [Convert Weight](https://www.w3schools.com/howto/howto_js_weight_converter.asp) [Convert Temperature](https://www.w3schools.com/howto/howto_js_temperature_converter.asp) [Convert Length](https://www.w3schools.com/howto/howto_js_length_converter.asp) [Convert Speed](https://www.w3schools.com/howto/howto_js_speed_converter.asp) ## Blog [Get a Developer Job](https://www.w3schools.com/howto/howto_blog_developer_job.asp) [Become a Front-End Dev.](https://www.w3schools.com/howto/howto_blog_become_frontenddev.asp) [Hire Developers](https://www.w3schools.com/howto/howto_blog_hire_developers.asp) # How TO - Add a Class [❮ Previous](https://www.w3schools.com/howto/howto_js_toggle_class.asp) [Next ❯](https://www.w3schools.com/howto/howto_js_remove_class.asp) *** Learn how to add a class name to an element with JavaScript. *** Add Class Click the button to add a class to me\! *** ## Add Class ##### Step 1) Add HTML: Add a class name to the div element with id="myDIV" (in this example we use a button to add the class). ### Example \<button onclick\="myFunction()"\>Try it\</button\> \<div id\="myDIV"\> This is a DIV element. \</div\> *** ##### Step 2) Add CSS: Style the specified class name: ### Example .mystyle { width: 100%; padding: 25px; background-color: coral; color: white; font-size: 25px; } *** [REMOVE ADS](https://order.w3schools.com/plans) *** ##### Step 3) Add JavaScript: Get the \<div\> element with id="myDIV" and add the "mystyle" class to it: ### Example function myFunction() { var element = document.getElementById("myDIV"); element.classList.add("mystyle"); } [Try it Yourself »](https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_add_class) *** **Tip:** Also see [How To Toggle A Class](https://www.w3schools.com/howto/howto_js_toggle_class.asp). **Tip:** Also see [How To Remove A Class](https://www.w3schools.com/howto/howto_js_remove_class.asp). **Tip:** Learn more about the [classList](https://www.w3schools.com/jsref/prop_element_classlist.asp) property in our JavaScript Reference. **Tip:** Learn more about the [className](https://www.w3schools.com/jsref/prop_html_classname.asp) property in our JavaScript Reference. [❮ Previous](https://www.w3schools.com/howto/howto_js_toggle_class.asp) [Next ❯](https://www.w3schools.com/howto/howto_js_remove_class.asp) [★ +1](https://profile.w3schools.com/log-in?redirect_url=https%3A%2F%2Fwww.w3schools.com%2Fhowto%2Fhowto_js_add_class.asp "Your W3Schools Profile") [Sign in to track progress](https://profile.w3schools.com/log-in?redirect_url=https%3A%2F%2Fpathfinder.w3schools.com&origin=https%3A%2F%2Fwww.w3schools.com%2Fhowto%2Fhowto_js_add_class.asp "Sign in to track your progress") [![Get Certified Offer](https://www.w3schools.com/images/img_2026easter_course_300.webp)](https://campus.w3schools.com/collections/course-catalog) #### [COLOR PICKER](https://www.w3schools.com/colors/colors_picker.asp) [![colorpicker](https://www.w3schools.com/images/colorpicker2000.png)](https://www.w3schools.com/colors/colors_picker.asp) [REMOVE ADS](https://order.w3schools.com/plans) *** [PLUS](https://order.w3schools.com/plans "Become a PLUS user and unlock powerful features") [SPACES](https://www.w3schools.com/spaces/index.php "Get your own website with W3Schools Spaces") [GET CERTIFIED](https://campus.w3schools.com/collections/certifications "Document your knowledge by getting certified") [FOR TEACHERS](https://www.w3schools.com/academy/index.php "Contact us about W3Schools Academy for educational institutions") [BOOTCAMPS](https://www.w3schools.com/bootcamp/index.php "W3Schools Bootcamps") [CONTACT US]("Contact us about sales or errors") × ## Contact Sales If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com ## Report Error If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com ##### Top Tutorials [HTML Tutorial](https://www.w3schools.com/html/default.asp) [CSS Tutorial](https://www.w3schools.com/css/default.asp) [JavaScript Tutorial](https://www.w3schools.com/js/default.asp) [How To Tutorial](https://www.w3schools.com/howto/default.asp) [SQL Tutorial](https://www.w3schools.com/sql/default.asp) [Python Tutorial](https://www.w3schools.com/python/default.asp) [W3.CSS Tutorial](https://www.w3schools.com/w3css/default.asp) [Bootstrap Tutorial](https://www.w3schools.com/bootstrap/bootstrap_ver.asp) [PHP Tutorial](https://www.w3schools.com/php/default.asp) [Java Tutorial](https://www.w3schools.com/java/default.asp) [C++ Tutorial](https://www.w3schools.com/cpp/default.asp) [jQuery Tutorial](https://www.w3schools.com/jquery/default.asp) ##### Top References [HTML Reference](https://www.w3schools.com/tags/default.asp) [CSS Reference](https://www.w3schools.com/cssref/index.php) [JavaScript Reference](https://www.w3schools.com/jsref/default.asp) [SQL Reference](https://www.w3schools.com/sql/sql_ref_keywords.asp) [Python Reference](https://www.w3schools.com/python/python_reference.asp) [W3.CSS Reference](https://www.w3schools.com/w3css/w3css_references.asp) [Bootstrap Reference](https://www.w3schools.com/bootstrap/bootstrap_ref_all_classes.asp) [PHP Reference](https://www.w3schools.com/php/php_ref_overview.asp) [HTML Colors](https://www.w3schools.com/colors/colors_names.asp) [Java Reference](https://www.w3schools.com/java/java_ref_keywords.asp) [AngularJS Reference](https://www.w3schools.com/angularjs/angularjs_ref_directives.asp) [jQuery Reference](https://www.w3schools.com/jquery/jquery_ref_overview.asp) ##### Top Examples [HTML Examples](https://www.w3schools.com/html/html_examples.asp) [CSS Examples](https://www.w3schools.com/css/css_examples.asp) [JavaScript Examples](https://www.w3schools.com/js/js_examples.asp) [How To Examples](https://www.w3schools.com/howto/default.asp) [SQL Examples](https://www.w3schools.com/sql/sql_examples.asp) [Python Examples](https://www.w3schools.com/python/python_examples.asp) [W3.CSS Examples](https://www.w3schools.com/w3css/w3css_examples.asp) [Bootstrap Examples](https://www.w3schools.com/bootstrap/bootstrap_examples.asp) [PHP Examples](https://www.w3schools.com/php/php_examples.asp) [Java Examples](https://www.w3schools.com/java/java_examples.asp) [XML Examples](https://www.w3schools.com/xml/xml_examples.asp) [jQuery Examples](https://www.w3schools.com/jquery/jquery_examples.asp) [Get Certified](https://campus.w3schools.com/collections/course-catalog) [HTML Certificate](https://campus.w3schools.com/collections/certifications/products/html-certificate) [CSS Certificate](https://campus.w3schools.com/collections/certifications/products/css-certificate) [JavaScript Certificate](https://campus.w3schools.com/collections/certifications/products/javascript-certificate) [Front End Certificate](https://campus.w3schools.com/collections/certifications/products/front-end-certificate) [SQL Certificate](https://campus.w3schools.com/collections/certifications/products/sql-certificate) [Python Certificate](https://campus.w3schools.com/collections/certifications/products/python-certificate) [PHP Certificate](https://campus.w3schools.com/collections/certifications/products/php-certificate) [jQuery Certificate](https://campus.w3schools.com/collections/certifications/products/jquery-certificate) [Java Certificate](https://campus.w3schools.com/collections/certifications/products/java-certificate) [C++ Certificate](https://campus.w3schools.com/collections/certifications/products/c-certificate) [C\# Certificate](https://campus.w3schools.com/collections/certifications/products/c-certificate-1) [XML Certificate](https://campus.w3schools.com/collections/certifications/products/xml-certificate) [**](https://www.linkedin.com/company/w3schools.com/ "W3Schools on LinkedIn") [**](https://discord.com/invite/w3schools "Join the W3schools community on Discord") [**](https://www.facebook.com/w3schoolscom/ "W3Schools on Facebook") [**](https://www.instagram.com/w3schools.com_official/ "W3Schools on Instagram") [FORUM](https://www.w3schools.com/forum/index.php "Forum") [ABOUT](https://www.w3schools.com/about/default.asp "About W3Schools") [ACADEMY](https://www.w3schools.com/academy/index.php "Contact us about W3Schools Academy for educational institutions and organizations") W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our [terms of use](https://www.w3schools.com/about/about_copyright.asp), [cookies]() and [privacy policy](https://www.w3schools.com/about/about_privacy.asp). [Copyright 1999-2026](https://www.w3schools.com/about/about_copyright.asp) by Refsnes Data. All Rights Reserved. [W3Schools is Powered by W3.CSS](https://www.w3schools.com/w3css/default.asp). \--\>
Readable Markdown
## How TO - Add a Class *** Learn how to add a class name to an element with JavaScript. *** Click the button to add a class to me\! *** ## Add Class ##### Step 1) Add HTML: Add a class name to the div element with id="myDIV" (in this example we use a button to add the class). ### Example \<button onclick\="myFunction()"\>Try it\</button\> \<div id\="myDIV"\> This is a DIV element. \</div\> *** ##### Step 2) Add CSS: Style the specified class name: ### Example .mystyle { width: 100%; padding: 25px; background-color: coral; color: white; font-size: 25px; } *** *** ##### Step 3) Add JavaScript: Get the \<div\> element with id="myDIV" and add the "mystyle" class to it: ### Example function myFunction() { var element = document.getElementById("myDIV"); element.classList.add("mystyle"); } [Try it Yourself »](https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_add_class) *** **Tip:** Also see [How To Toggle A Class](https://www.w3schools.com/howto/howto_js_toggle_class.asp). **Tip:** Also see [How To Remove A Class](https://www.w3schools.com/howto/howto_js_remove_class.asp). **Tip:** Learn more about the [classList](https://www.w3schools.com/jsref/prop_element_classlist.asp) property in our JavaScript Reference. **Tip:** Learn more about the [className](https://www.w3schools.com/jsref/prop_html_classname.asp) property in our JavaScript Reference.
Shard40 (laksa)
Root Hash10756103332767711440
Unparsed URLcom,w3schools!www,/howto/howto_js_add_class.asp s443