var newLink=[]; newLink[0] ='<link rel="stylesheet" type="text/css" href="CSS0.css" />'; newLink[1] ='<link rel="stylesheet" type="text/css" href="CSS1.css" />' $('link[rel=stylesheet]').replaceWith(newLink[1])