Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特定の要素のコンテンツからメタ記述を自動的に生成する javascript/jquery スクリプトをページに含めたいと考えています。しかし、どこから始めればよいかわかりません。ここで誰かが私を案内してくれますか?
新しいメタタグを作成し、その名前属性と値属性を対象の要素のコンテンツに設定するのと同じくらい簡単です。
$('<meta />').attr({ name: 'description', value: $('#idOfElementWidthDescriptionContent').text() }).appendTo('body');