【发布时间】:2012-03-01 04:08:01
【问题描述】:
我正在尝试替换以下代码中的 CSS 样式:
var theHTML = this.html();
theHTML.replace("style=\"display:none;\"", "style=\"display:inline;\"");
alert(theHTML);
html 看起来像这样:
<IMG SRC="picturesFromServer.asp?PhotoId=365481" style="display:none;">
但是,一旦我检查它是否更改了它,它会一直显示无而不是内联。我只是想在打印之前让它可见。
【问题讨论】:
-
为什么 HTML 首先有
style="display:none;"? -
@Madmartigan:对用户隐藏图像。然后打印出来。提示这就是为什么我想在打印之前显示它。
标签: javascript jquery css str-replace