I have a meta http-equiv="refresh"
inside the <head>
.
<head>
<meta name="mymeta" http-equiv="refresh" content="2" id="myMeta">
</head>
Using Javascript, I'm trying to change the content
attribute of this meta
tag.
var myMeta = document.getElementById("myMeta");
myMeta.content="10";
When I display the content via document.write(myMeta.content);
, I get the changed value which is 10, however, the meta
tag will keep refreshing each 2 seconds.
I have tested this both in Firefox and Opera.
FULL PAGE
<!DOCTYPE html>
<html>
<head>
<meta name="mymeta" http-equiv="refresh" content="2" id="myMeta">
<script>
var myMeta=document.getElementById("myMeta");
myMeta.content="10";
document.write(myMeta.content);
</script>
</head>
<body>
</body>
</html>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…