Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

flash input

/**
 * Fait clignoter un champ input pour attirer l'attention sur celui - ci
 * 
 * It takes a CSS selector, a time in milliseconds, a border color and a background color, and then
 * flashes the border and background of the element selected by the CSS selector
 * 
 * @param string selecteur_css 
 * @param int time temps en milliseconde du clignotement 
 * @param string borderColor couleur que va prendre la bordure lors du clignotement 
 * @param string backgroundColor couleur que va prendre la background lors du clignotement
 */

function input_flash(selecteur_css , time = 150 , borderColor = "red" , backgroundColor = "yellow" ){

    let input = document.querySelector(selecteur_css);

    let borderColorOrigine      = input.style.borderColor;
    let backgroundColorOrigine  = input.style.backgroundColor;

    input.style.borderColor     = borderColor;
    input.style.backgroundColor = backgroundColor;

  setTimeout(() => {     
        input.style.borderColor     = borderColorOrigine;
        input.style.backgroundColor = backgroundColorOrigine;
    }, time);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: react native password input 
Javascript :: python json save to file 
Javascript :: react native debug apk 
Javascript :: mongodb check for array not empty query 
Javascript :: how to get element by title js 
Javascript :: new MiniCssExtractPlugin({ ^ TypeError: MiniCssExtractPlugin is not a constructor 
Javascript :: how to check variable type jquery 
Javascript :: javascript go to top of page 
Javascript :: jquery datepicker no weekends 
Javascript :: javascript set left margin 
Javascript :: zip code regex 
Javascript :: model show in jquery 
Javascript :: javascript uppercase first letter 
Javascript :: react native cover image 
Javascript :: axios send bearer token 
Javascript :: explode in jquery 
Javascript :: how to make an alphabet in javascript 
Javascript :: prevent default window on right click menu 
Javascript :: jquery check if empty object 
Javascript :: apex charts cdn 
Javascript :: get current url in javascript till / 
Javascript :: javascript disable right click 
Javascript :: page reload timeout 
Javascript :: javascript appendchild image node 
Javascript :: js post 
Javascript :: vue 3 cdn 
Javascript :: on scroll page jquery 
Javascript :: discord.js check if user is admin 
Javascript :: check comma in string javascript 
Javascript :: autocomplete off using jquery 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =