标签:on() ntb doctype str htm set exp get demo1
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<button onclick="myFunction()">try it!</button>
<p id="demo1">Paul,Paula,Pauline,paul,Paul</p>
<script>
function myFunction()
{
var str = document.getElementById("demo1").innerHTML;
var txt = str.replace("Paul","Ringo");
document.getElementById("demo1").innerHTML = txt;
}
</script>
</body>
</html>
标签:on() ntb doctype str htm set exp get demo1
原文地址:https://www.cnblogs.com/superyucong/p/9867852.html