js怎么改变html的meta content里面的值
<metaname="viewport"content="width=device-width,initial-scale=1.0,user-scalable=yes">...
<meta name="viewport"content="width=device-width,initial-scale=1.0, user-scalable=yes">
就是动态加载,在某个条件为true时,加载<meta name="viewport"content="width=device-width,initial-scale=1.0, user-scalable=yes">
条件为false时,加载<meta name="viewport"content="width=device-width,initial-scale=1.0, user-scalable=no"> 展开
就是动态加载,在某个条件为true时,加载<meta name="viewport"content="width=device-width,initial-scale=1.0, user-scalable=yes">
条件为false时,加载<meta name="viewport"content="width=device-width,initial-scale=1.0, user-scalable=no"> 展开
1个回答
展开全部
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=yes">
<script type="text/javascript">
var oMeta = document.getElementsByTagName('meta')[1]; //第二个
oMeta.content = "phone";
alert(oMeta.content);
</script>
追问
这个属性弹出框输出是,user-scalable= yes"改变了,但页面还是不起作用
追答
寻找其它方法吧,我也知道页面没变化
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询