Wednesday, 28 December 2011

create element in javascript

This is a javascript to insert in the head tag. Similarly to this, we can use it for other elements.

var headID = document.getElementsByTagName("head"[0];
var baseT = document.createElement('base');
baseT.target = '_self';
headID.appendChild(baseT);

No comments:

Post a Comment