【发布时间】:2016-10-21 15:50:44
【问题描述】:
我已经阅读了很多不同的帖子,但我不明白为什么这对我不起作用。任何帮助将不胜感激。我相信这很简单。
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<script type="text/javascript">
$("body").children().each(function() {
$(this).html($(this).html().replace(/®/g,"<sup>®</sup>"));
});
</script>
</head>
<body>
<div>HelloWorld®</div>
</body>
</html>
【问题讨论】:
-
你想达到什么目的?
-
您正在使用 jQuery-isms(例如
$()),但您的页面似乎没有在<script>标记中加载 jQuery.. -
问题解决后不要更新问题,使用解决问题的答案旁边的绿色复选标记。
-
那是我的错,抱歉新来的。感谢您的反馈
标签: javascript replace find