Redirection in JavaScript
Always needed tip: window.location.href = “https://kavecan.com”;
Always needed tip: window.location.href = “https://kavecan.com”;
You can use jQuery’s inArray function. Ie, to check if array myArray contains number 10 in it, you can use next code: if ($.inArray( myArray, 10) !== -1) { alert(“Yes, array myArray contains number 10 as one of it’s elements!”); } else { alert(“Nope, array myArray doesn’t contains number 10!”); }
User clicked on link, how to get it’s ID? $(“.myLinkClass”).live(‘click’, function() { var linkIdValue = $(this).attr(“id”); alert(linkIdValue); })
If you want to check if your checkbox with ID defined as option_2 is checked, you can use next code: if ( $(‘#option_2’).attr(‘checked’) ) { alert(‘Yep, your checkbox is checkd’); } else { alert(‘Nope, your checkbox is not checked’); } Also, if you want to set some of your checkboxes as checked, you can do:…