Copying CSS to inline using jquery (or retaining formatting when copying stuff from a web page)

前端 未结 6 1770
渐次进展
渐次进展 2020-12-14 02:36

I could probably muddle through the code for this, but before I do I thought I\'d ask if there\'s a quick and/or built-in way or plugin for this...

Given a table wit

6条回答
  •  旧巷少年郎
    2020-12-14 03:13

    Use plain JavaScript for this :

    $('.mytable').style.cssText;
    

    Your welcome ;]

    ps. same for adding inline css:

    $('.mytable').style.cssText = "border:1px solid red;";
    

提交回复
热议问题