Add id to body tag based on url jQuery

Developer
Size
1,501 Kb
Views
66,792

How do I make an add id to body tag based on url jquery?

Add id to body based on URL. What is a add id to body tag based on url jquery? How do you make a add id to body tag based on url jquery? This script and codes were developed by Mia Sno on 12 August 2022, Friday.

Add id to body tag based on url jQuery Previews

Add id to body tag based on url jQuery - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Add id to body tag based on url jQuery</title>
</head>
<body> <script src="js/index.js"></script>
</body>
</html>

Add id to body tag based on url jQuery - Script Codes JS Codes

/* add id to body tag based on url to help with styles such as adding active styles or whatever */
if ((window.location.href.indexOf("A2") > -1) ||
(window.location.href.indexOf("a2") > -1)) {	$('body').attr('id','version_a2')
} else if ((window.location.href.indexOf("A3") > -1) ||
(window.location.href.indexOf("a3") > -1)) {	$('body').attr('id','version_a3')
}
Add id to body tag based on url jQuery - Script Codes
Add id to body tag based on url jQuery - Script Codes
Home Page Home
Developer Mia Sno
Username mrs_snow
Uploaded August 12, 2022
Rating 3
Size 1,501 Kb
Views 66,792
Do you need developer help for Add id to body tag based on url jQuery?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Mia Sno (mrs_snow) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!