
Untitled
By: a guest on
Jan 19th, 2012 | syntax:
None | size: 0.49 KB | hits: 183 | expires: Never
<!doctype html>
<html lang="en">
<head>
<style type="text/css">
.box {
background-color:#FFFF00;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
<script>
[].forEach.call( document.querySelectorAll('.box'), function(el) {
el.style.color = 'red'; // or add a class
});
</script>
<div class="box">
This is red
</div>
<script>
$(‘.box’).css(‘color’, ‘red’);
</script>
</body>
</html>