Define style dinamically

I would like to know if it is possible to define styles to apply to the tag of a html page with javascript before displaying it,
in practice I would like to pop up to request color, size, etc., at first, then run the javascript code
that prepares the style of the tag and the end view the page with the settings