Q:

What is the correct way to attribute a Stack Overflow answer in my code?

I understand that Stack Overflow answers are released under a Creative Commons license, and that I may use code from Stack Overflow answers (such as this one) in my work.
I want to give credit (as this question mentions that I should) to the OP, how exactly should I do this? I was thinking of adding something along these lines above the relevant code:
// Code created with the help of Stack Overflow question
// https://stackoverflow.com/questions/3808808/how-to-get-element-by-class-in-javascript
// Question by Taylor:
// https://stackoverflow.com/users/460058/taylor
// Answer by Andrew Dunn:
// https://stackoverflow.com/users/451672/andrew-dunn

That's right, right?

A:

The Attribution Required blog post describes the attribution requirements in detail.
That said, if someone uses a small snippet of code that I post in a public forum for people to freely use, I don't particularly care that it be attributed back to me.  In fact, some users feel strongly enough about this that they put a disclaimer in their profile.  
I view the CC:Wiki license as more of a protection against leeches that wholesale copy material from Stack Overflow and create their own websites with it, without giving credit to Stack Overflow or the original authors of the material.

