Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- how to intergrate my code with jquery cookie
- $(document).ready(function() {
- $('.SearchResaultBodyFullUseFulls input[type="checkbox"]').click(function() {
- $(this).parent().parent().parent().parent().parent().parent().toggleClass('checked');
- });
- });
- $.cookie('the_cookie', 'the_value');
- $(document).ready(function() {
- // Check for cookie on page load, and set checkbox value accordingly
- if ($.cookie('MyCookie')) {
- $('.SearchResaultBodyFullUseFulls input[type="checkbox"]').attr("checked","checked");
- }
- // Set cookie on change of value
- // You may consider changing this logic to set the cookie on form submission,
- // however you've not given enough information about your form for me to show this.
- $('.SearchResaultBodyFullUseFulls input[type="checkbox"]').click(function() {
- $(this).parent().parent().parent().parent().parent().parent().toggleClass('checked');
- $.cookie('MyCookie', $(this).is(":checked"));
- });
- });
Add Comment
Please, Sign In to add comment