How can I change a stylesheet using jquery in div tag on html? or what is the jquery code for changing stylesheets?
in javascript, we use the below code :
I use this code to enable or disable a stylesheet based on a page.
$(document).on('pagebeforeshow', function () {
var URL = $.mobile.path.parseUrl(window.location).toString().toLowerCase();
if (URL.indexOf("/investment.aspx") > -1 ||
URL.indexOf("/employees.aspx") > -1) {
$("link[href^='../../Public/LongLabels.css']").attr("media", "all");
}
else {
$("link[href^='../../Public/LongLabels.css']").attr("media", "not all");
}
});