function loadjscssfile(filename, filetype)
{
if (filetype=="css")
{
var fileref = document.createElement("link");
fileref.rel = "stylesheet";
fileref.type = "text/css";
fileref.href = "filename";
document.getElementsByTagName("head")[0].appendChild(fileref)
}
}
loadjscssfile("cssgreen.css", "css")
and in my html I have
<a href="javascript:loadjscssfile('cssgreen.css','css')">Load green</a>
is there an issue in the html or the js, im fairly new to this so i could be making some mistakes