更新meta标签的content属性 [英] Update the content attribute of the meta tag
本文介绍了更新meta标签的content属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个:
<meta name="description" content="NEED_TO_UPDATE_THIS" />
<meta name="keywords" content="" />
,我需要使用jQuery更新名称为"description"的元标记的内容.如何使用选择器选择该标签的内容属性?
and i need to update the content of meta tag that has the name="description" using jQuery. How can i use the selectors to choose that content atribute of that tag?
谢谢
推荐答案
$('meta[name=description]').attr('content', 'new value');
尽管这样做没有多大意义,因为使用此标记的网络抓取工具通常不支持javascript.
Although doing this doesn't make much sense because web crawlers which use this tag usually don't support javascript.
这篇关于更新meta标签的content属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文