开发者

remove elements with "display: none;" for email using javascript

I'm generating a email from a web page and taking a section of the page and putting it into the email. The problem is the section of code has elements with "display: none;" and some email clients don't recognise the display:none property which then displays unwanted elements in the email.

I want to remove these elements using some simple javascript i already remove elements with certain classes now i want to开发者_如何学Go remove elements with certain styles, the styles are inline. I'm using jquery with the site.


Use the :hidden selector:

$(":hidden").remove();


  $("div[style*='display:none']").remove();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜