I want to add class to table tag using following command inside
script tag.
<script>
(document).ready( function() {
$('tr:odd').addclass('odd');
$('tr:even').addclass('even');
alert("abc'); //
for debugging
$('th').parent().addclass('table-heading');
}
);
</script>
CSS has all the tree class declared
.odd {
background-color: #fcc;
}
.even {
background-color: #cef;
}
.table-heading {
font-size: 12px;
}
CSS is linked properly and if I add class manually I can see the
stylesheet applied to the page.
But I cannot get the alert neither I can see the class in <tr> tag.
The File is loaded correctly.
And I tried both <%= javascript_include_tag 'jquery' %> <%=
javascript_include_tag "jquery.js" %>
And both load the file correctly.
Moreover I can see the JavaScript (JQuery.js) loaded using firebug.