var htmlAttributes= [ {attrName:'class',attrValue:'样式名称'} //for IEs , {attrName:'className',attrValue: '样式名称'} //for ff ] var domParams={domTag:'div', content:'动态div的innerHTML', otherAttributes:htmlAttributes}; var newHtmlDom=dynCreateDomObject(domParams); //通过setAttribute('style','position:absolute.....................') //的形式来指定style没有效果,只能通过如下形式,jiong newHtmlDom.style.zIndex='8888'; newHtmlDom.style.position='absolute'; newHtmlDom.style.left='100px'; newHtmlDom.style.top='200px';
您可能感兴趣的文章: