setting a whole style string to an element from javascript (not individual style parameters)

前端 未结 3 747
抹茶落季
抹茶落季 2020-12-09 08:06

I need to set an arbitrary style to a span via javascript.

I know I can do things like: span.style.height=\"250px\"; But I need to be able to insert a r

3条回答
  •  情话喂你
    2020-12-09 08:53

    There is element.setAttribute('style', '...');, but it fails in IE.

    There is a solution, but I haven't tried.

提交回复
热议问题