---
title: "Discussion on \"Create a button that changes element text color on click in JavaScript\" | Hashnode"
description: "Discussion on \"Create a button that changes element text color on click in JavaScript\". We have to create a button in HTML which will change the text color of the heading on click. \nWe will be going to see how to do this in JavaScript step by step.\nStep 1 - Create a HTML structure\nIn HTML, we will create one H1 tag and one Button.\n<!DOC..."
url: "https://hashnode.com/posts/create-a-button-that-changes-element-text-color-on-click-in-javascript/611fbe12a5d08237f40deebd"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Create a button that changes element text color on click in JavaScript](https://omgaikwad.hashnode.dev/create-a-button-that-changes-element-text-color-on-click-in-javascript?utm_source=hashnode&utm_medium=feed)

We have to create a button in HTML which will change the text color of the heading on click. We will be going to see how to do this in JavaScript step by step. Step 1 - Create a HTML structure In HTML, we will create one H1 tag and one Button. <!DOC...

Aug 20, 2021 · 2 min read · omgaikwad.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#tutorial](https://hashnode.com/tag/tutorial)
-   [#css](https://hashnode.com/tag/css)
-   [#html5](https://hashnode.com/tag/html5)
-   [#css3](https://hashnode.com/tag/css3)

## Written by

[Om Gaikwad](https://hashnode.com/@omgaikwad)

@omgaikwad

  
[View profile](https://hashnode.com/@omgaikwad)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
