onclick change text color javascript

<script>

    document.getElementById('change').onclick = changeColor;   

    function changeColor() {
        document.body.style.color = "purple";
        return false;
    }   

</script>

4.11
9

                                    &lt;script&gt;

    document.getElementById('change').onclick = changeColor;   

    function changeColor() {
        document.body.style.color = &quot;purple&quot;;
        return false;
    }   

&lt;/script&gt;

4.11 (9 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
onclick color change in javascript html inline javascript change color onclick event javascript on button click by id change color onclick event change color w3school change button color onclick javascript how to make element change color onclick change element color on click change element color onclick change button text and background color with onclick event click button and change color javascript How to change the color onClick using JavaScript button change color en click js html onclick change color html change colour of text when on click javascript change color and text on click javascript click button change color change color on p element on click js js change text color after clicking on button how to change color on click js javascript change button color onclick on click java script change color change text color on button click with javascript change text color on click with javascript onclick change color of the text in javascript click on element change color how to change the color of text in onclick how to change the color of a element onclick function in javascript how to change the color of a element onclick function how to change the color of a element on click functin on click colour change button JS function js click change color js color change on click change text and color when button is click javascript change text color when button is click js onclick text color add javascript onclick change colour change color of element on click javascript change color onclick click change color js change div color on click javascript script onclick change color javascript click to change color javascript color change on click html in text onclick change color html intext onclick change color javascript button onclick change color javascript button click change color js change text color on click change element color on click javascript change button color on click javascript onclick font color change in javascript javascript click change color onclick change this color in js onclick change this.color in js onclick change color in js how to change the color of a button onclick event in javascript onclick to change color onclick function change colour javascript onclick change color w3schools javascript onclick change color onclick button chnage the color of the consoole text in javascript &lt;p onclick=&quot;myfunction(this,red)&quot;&gt; click me to change my text color change text color when you click it in javascript onclick change color js how to change the color using a text is clicked using javascript DOM change color in javascript handleClick changing div color onclick javascript change color on click with js javascript onclick change color of div javascript click button to change color and do something change color on click dom changing an element colour using onclick change color javascript onclick function change color onclick change color when click javascript change color of element onclick onclick element change color css change color when onclick javascript change color onclick javascriopt change button color onclick using javascript js make button change color on click dom add text and color to a button javascript button that changes color onclick js change color on click with this How to change text color on button click in javascript js change text color when clicked this color change on click javascript change color when clicked javascript button javascript on click change color change bg color onclick javascript javascript onclick button color change html onclick event change color javascript button change color onclick change color of text when clicked button javascript change button color onclick javascript how to onclick change input tag color in javascript onclick=&quot;changeColor()&quot; javascript onclick change button color in html onclick change colour javascript change color of button onclick javascript function onclick to make color change reaact javascript function onclick to make color change javascirpt change text colro in a function javascript apply color on click how to change color of text inside button in javascript change textbox color javascript js onclick color change on linck event color javascript change all text color color button click event in javascript chnage text color in javascript javascript that changes color on click js btn color change by click change css using javascript onclick change button color in js js button text change onclick change color change button color on click html how to change text color on click in css javascript change color text When one of these elements is clicked, the text colour must change to blue javascript click to change color javascript change color on click js change color by click event javascript change color by click javascript change color that is not clicked javascript change button onclick change the text color in javascript javascript change text color js change text colr how to change text color event listener javascript change button text color javascript change color of all text js change color onclick js how to color a text in javascript change text field color javascript text color change in js js on click change color html onclick color change javascript button onclick color change javascript change color on click change color onclick how to change the text color using onclick in html how to change a color of a text using onclick in html if onclick event change color javascript onclick color change of html onclick button color change javascript onclick color change change color on click change color on click javascript on click change color onclick color change click color change javascript label onclick jquery color change on click change color javascript js change color on click onclick color change javascript javascript change font color on click javascript change color of text on click change color onclick javascript javascript change text color on click javascript onclick event change color js onclick change color javascript change element color on click how to change text color js html how to change placeholder color using javascript change html element color CSS how to change text color when clicked without javascript onclick change text color javascript
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source