javascript - Why does setting a new attribute initiate a FOUC? -


i'm using element.setattribute set element's href attribute after user input.

i noticed if set href on pageload (before user input) placeholder value (e.g. empty string), setting attribute works expected.

if don't set placeholder href initially, setattribute has create attribute, , see fouc in button text.

as far know, setattribute doesn't trigger reflow or repaint of dom or element.

here's looks like:

enter image description here

i understand how fix -- i'm curious why happens. can tell me what's going on under hood?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -