$(
"head"
).append($(
"<link id="miCSS" rel='stylesheet' href='style.css' type='text/css' media='screen' />"
));
Si queremos modificar el SRC de un CSS ya cargado con anterioridad:
$("#miCSS").attr("href", "otroestilo.css");
También se puede hacer de esta otra manera:
$("<link/>", {
rel: "stylesheet",
type: "text/css",
href: "/styles/yourcss.css"
}).appendTo("head");
No hay comentarios:
Publicar un comentario