Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery random color array

// jQuery Random Color on button click
let myColors = ['red', 'green', 'blue', 'pink'];

$('button').click(function(){

    let randomColor = myColors[Math.trunc(Math.random() * myColors.length)];
    $('h1').css('color', randomColor);

});
Comment

PREVIOUS NEXT
Code Example
Javascript :: adding object into object 
Javascript :: set body angle matter.js 
Javascript :: detect finishing write react input 
Javascript :: grapql file upload 
Javascript :: link the filename to the visible layer 
Javascript :: vue router accept params null 
Javascript :: react native segmented control tab 
Javascript :: Using anonymous functions as arguments of other functions 
Javascript :: javascript ejemplo de template literal anidados 
Javascript :: javascript cast everything to string 
Javascript :: javascript check if input is empty 
Javascript :: javascript refresh function every 5 seconds 
Javascript :: Cycle through a list to see if there is a match for the characters entered into an input box 
Javascript :: readonly checkbox angular 
Javascript :: Half or Left Triangle Pattern in JavaScript 
Javascript :: use variable in form action vuejs 
Javascript :: how to define array in react js 
Javascript :: signed url to get file from s3 bucket 
Javascript :: js what does the vertical line symbol do 
Javascript :: react modal scroll 2 overlapping components 
Javascript :: jquery selected checkboxes pass as paramater to C# 
Javascript :: jacascript loop array 
Javascript :: variable local and global 
Javascript :: createSearchParams 
Javascript :: sw.js 
Javascript :: anonymous functions 
Javascript :: javascript Big decimal 
Javascript :: data toggle modal and tooltip 
Javascript :: javascript executes a script ________ 
Javascript :: should i use map for form fields react 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =