All posts in: How to

How to check or uncheck a checkbox with jQuery

Check or uncheck a checkbox with jQuery is a simple task and can be achieved very easily. If you are using jQuery 1.5 and below you need to use .attr(). Here it is To check use $('.checkbox').attr('checked','checked'); To uncheck use ...

How to scale CSS background to desired dimensions

One can easily scale background in CSS to any dimension to fit its container. 100% CSS background is good looking and gives bump to your design. Here is how this can be done. #MyID { background-size: 70% 60%; /* 70% width and 60% height ...

How to cancel Ajax requests using jQuery

Since XMLHttpRequest ,or the equivalent, object is returned by jQuery, so you can simply use abort function. To cancel ajax requests you have to follow below code. var myRequest= $.ajax({ type: "POST", url: "file.php", data: ...