AddClass tutu
How do I make an addclass tutu?
What is a addclass tutu? How do you make a addclass tutu? This script and codes were developed by Gonchar Dima on 21 August 2022, Sunday.
AddClass tutu - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>addClass tutu</title>
</head>
<body> <!DOCTYPE HTML>
<html>
<head> <meta charset="utf-8"> <script src="https://js.cx/test/libs.js"></script> <script src="test.js"></script>
</head>
<body> <script> function addClassByStrMeth(obj, cls){ if(obj.className.length===0){ obj.className+=cls; } if(obj.className.indexOf(cls)===-1){ obj.className=obj.className+' '+cls; } } function addClass(obj, cls){ var check = false; var arr = obj.className.split(' '); for (var i=0; i<arr.length; i++){ if (arr[i]===cls) { check = true; } } if (!check) { arr.push(cls); obj.className = arr.join(' '); obj.className = obj.className.trim(); } } </script>
</body>
</html> <script src="js/index.js"></script>
</body>
</html>
AddClass tutu - Script Codes JS Codes
describe("addClass", function() { it("добавляет класс, которого нет", function() { var obj = { className: 'open menu' }; addClass(obj, 'new'); assert.deepEqual(obj, { className: 'open menu new' }); }); it("не добавляет класс, который уже есть", function() { var obj = { className: 'open menu' }; addClass(obj, 'open'); assert.deepEqual(obj, { className: 'open menu' }); }); it("не добавляет лишних пробелов, который уже есть", function() { var obj = { className: '' }; addClass(obj, 'open'); assert.deepEqual(obj, { className: 'open' }); });
});
Developer | Gonchar Dima |
Username | crauler |
Uploaded | August 21, 2022 |
Rating | 3 |
Size | 1,792 Kb |
Views | 38,456 |
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!
Name | Size |
Truncate Str tutu | 1,673 Kb |
AboutCompany_mtkpress.ru | 8,145 Kb |
News_Vesta_mtkpress.ru | 1,815 Kb |
Modal window tutu | 3,278 Kb |
Table diagonal | 1,472 Kb |
Fibonachi tutu | 1,672 Kb |
Gallery css | 1,901 Kb |
Contacts mtk | 5,947 Kb |
A Pen by Gonchar Dima | 1,760 Kb |
Footer mtkpress.ru | 5,388 Kb |
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!
Name | Username | Size |
Blockquote design | Sjmcpherson | 1,863 Kb |
Multiple jCarousel | Pafnuty | 2,461 Kb |
CSS Donut Charts | Seanstopnik | 2,908 Kb |
Lecture 1 | Law | 0 Kb |
DNA Double Helix | Hugo | 5,112 Kb |
A Pen by Ben Babics | Benbabics | 2,957 Kb |
The Rope | Chribbe | 2,886 Kb |
Getting Started | Viblast | 1,500 Kb |
Scifi-style Radio-based Tab | Aaronchuo | 4,427 Kb |
Responsive Menu I | Rodericksandoval | 3,045 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!