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:
i understand how fix -- i'm curious why happens. can tell me what's going on under hood?
Comments
Post a Comment