Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

onclick change text color javascript

<script>

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

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

</script>
Comment

javascript-change color onclick()

const btn = document.querySelector('button');

function random(number) {
  return Math.floor(Math.random() * (number+1));
}

btn.onclick = function() {
  const rndCol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')';
  document.body.style.backgroundColor = rndCol;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to change the font family using jquery 
Javascript :: create array initialize size javascript 
Javascript :: queryselector attribute 
Javascript :: use set to remove duplicates in javascript 
Javascript :: Invariant Violation: requireNativeComponent: "RNSScreen" was not found in the UIManager 
Javascript :: js iterate array index 
Javascript :: JS get number of classes in html 
Javascript :: timer.tc elixir 
Javascript :: console.log red text on yellow background 
Javascript :: javascript for border color 
Javascript :: javascript go to page 
Javascript :: update node ubuntu 
Javascript :: javascript split array into chunks of 
Javascript :: pandas to json 
Javascript :: find year javascript 
Javascript :: how to prevent the form from getting automatically submitted javascript 
Javascript :: query params in next js 
Javascript :: common character count javascript 
Javascript :: js regex password 
Javascript :: js nearest 100 
Javascript :: jquery get div height 
Javascript :: how to get aria expanded value in javascript 
Javascript :: jquery select option value id no not exists 
Javascript :: rails is not defined javascript 
Javascript :: remover clase jquery 
Javascript :: getelementbytagname javascript 
Javascript :: jq html remove disabled 
Javascript :: convert buffer to base64 javascript 
Javascript :: bootstrap dropdown not working in angular 8 
Javascript :: js remove specific css property 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =