js动态添加style样式
var style = document.createElement('style')style.type = 'text/css'style.appendChild(document.createTextNode('input[type="checkbox"]:checked {\n' +'/* background-position: -48px 0; */\n' +'background:
·
var style = document.createElement('style')
style.type = 'text/css'
style.appendChild(document.createTextNode('input[type="checkbox"]:checked {\n' +
' /* background-position: -48px 0; */\n' +
' background: url(' + require('../../assets/select.png') + ') no-repeat center;\n' +
' background-size: contain;\n' +
'}'))
var head = document.getElementsByTagName('head')[0]
head.appendChild(style)
更多推荐
已为社区贡献2条内容
所有评论(0)