Jquery and JavaScript add to <head> Tags

How to add tags to with JavaScript or Jquery

Add to head is one thing a good website should always use almost at all page, canonical rel tags can't be one, meta titles, meta description must be updated on every page. This is a solution for that.


You can select it and add to it as normal for Jquery

$('head').append('');

For javascript

const link=document.createElement('link');
link.href='href';
link.rel='rel';
document.getElementsByTagName('head')[0].appendChild(link);