Here’s a screenshot of my chrome javascript console demonstrating my dilemma.

I seriously cannot understand why i can’t fetch the “value” attribute.
The “class” attribute works just fine, so i figure the same should apply to “value”.
The code (coffeescript) i’m testing in my app looks like this:
$ ->
$(".comment").click ->
alert $(this).attr 'value'
Neither this nor the code shown in this pic work.
Does anyone know what i’m doing wrong or what i SHOULD be doing? Thanks in advance!
Use
.val(). This will work only onselect, input, textareatags. For other tags,valueattribute is not valid.If you’re using latest jQuery, use
data-attirbutes instead: