I'm just getting started with jQuery and I attempted the following:
<input value="1" type="checkbox" name="mytable" id="checkbox2" style="float:left;" />
{literal}
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(function() {
//checkbox
$(".mytable").click(function(){
$(".mytable").toggleClass('mytableborders');
});
});
</script>
{/literal}
<table class="mytable" id="cart">....</table>
Unfortunately, it's not working as intended. My goal is for the checkbox to change the table's class from .mytable
to .mytableborders
.