<head>
<link href="foo.css" rel="stylesheet" type="text/css" />
</head>
can I via jquery change the href of this link from foo.css
to bar.css
$('link[href="foo.css"]').attr('href','bar.css');
have fun
Html:
<head>
<link id="test" href="foo.css" rel="stylesheet" type="text/css" />
</head>
<body>
...
</body>
And the jQuery:
$(document).ready(function() {
$("#test").attr("href", "bar.css");
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With