change meta content javascript code example
Example 1: javascript change meta tag
document.querySelector('meta[name="description"]').setAttribute("content", _desc);
Example 2: how to use a script to inject a meta attribute in html
document.addEventListener('requireready', function onRequireReady() {
require(['jquery'], function run($) {
$(document).ready(function () {
$(".className").closest("element").attr("tag", "value");
});
});
});