- Dom
- click
- inArray
- merge objects
- query string
- smartcheck
- attr
- addClass
- hasClass
- removeClass
- append
- prepend
- remove
- has
- findAll
- empty
- position
- offset
- outerWidth
- outerHeight
- replaceWith
- html
- text
- val
- parseHTML
- parseJSON
- parent
- next
- prev
- first
- last
- now
- toArray
- size
- Manipulation
- dates compare
- getMonthName
- getDayName
- .NET JSON date
- hashtag
- number Format
- pad
- smallCase
- upperCase
- Forms
- focus
- mobile number
- repetition
- placeholder
- Browser
- browser feature
- Browser Information
- Effects
- hide
- show
- sticky
- scrolline
- goUp
- Animation
- circles
- Google analytics
- Google fonts
.addClass()
Description: Add a HTML class to elements.
Example:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>addClass demo</title>
<script src="http://code.bitsycode.com/bitsycode-latest.min.js"></script>
<style type="text/css">
.yellow {
background-color: yellow;
}
</style>
</head>
<body>
<p>This is an example</p>
<script>
bitsyCode.ready(function(){
bitsyCode('p').addClass("yellow");
})
</script>
</body>
</html>
Preview:
This is an example
Share