Change font after createTextNode()

前端 未结 3 1354
天涯浪人
天涯浪人 2021-01-11 16:22

I need to change the font of element created by the createTextNode() function:

var s = document.createTextNode(item.text);
s.setAttribute(\"font size\") = -1         


        
3条回答
  •  再見小時候
    2021-01-11 16:46

    maybe you could use inline css. Never tried this with a textnode though

    setAttribute('style', 'font-size:-1;');
    

提交回复
热议问题