函数的介绍参考:http://www.w3school.com.cn/jsref/jsref_replace.asp

 

下列代码将Hello World!中的World替换为Jim

<html>
<body>

<script type="text/javascript">

var str="Hello World!"
document.write(str.replace("World","Jim"))

</script>
</body>
</html>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
相关资源
相似解决方案