Get checkbox value in jQuery

To get the value of the Value attribute you can do something like this: Or if you have set a class or id for it, you can: However this will return the same value whether it is checked or not, this can be confusing as it is different to the submitted form behaviour. To check … Read more

Resize image with javascript canvas (smoothly)

You can use down-stepping to achieve better results. Most browsers seem to use linear interpolation rather than bi-cubic when resizing images. (Update There has been added a quality property to the specs, imageSmoothingQuality which is currently available in Chrome only.) Unless one chooses no smoothing or nearest neighbor the browser will always interpolate the image after down-scaling it as this … Read more

Vertically centering a div inside another div

tl;dr Vertical align middle works, but you will have to use table-cell on your parent element and inline-block on the child. This solution is not going to work in IE6 & 7.Yours is the safer way to go for those.But since you tagged your question with CSS3 and HTML5 I was thinking that you don’t mind using a modern … Read more

a href link for entire div in HTML/CSS

UPDATE 06/10/2014: using div’s inside a’s is semantically correct in HTML5. You’ll need to choose between the following scenarios: which is semantically incorrect, but it will work. which is semantically correct but it involves using JS. which is semantically correct and works as expected but is not a div any more.

How to display image with JavaScript?

You could make use of the Javascript DOM API. In particular, look at the createElement() method. You could create a re-usable function that will create an image like so… Then you could use it like this… See a working example on jsFiddle: http://jsfiddle.net/Bc6Et/