jquery変数がありません。要素を適切に選択する方法がわからないため、最も似ています。Jqueryツリーのトラバースが機能しない
$('.upVote').click(function(e){
e.preventDefault();
var ratebox = $(this).find('.ratingBox'); //this variable isnt working
var answer_id = $(this).children('.record_id').attr('value'); //this one too
HTML::
<p class='ratingBox'> $answerrating[$f]</p>
<div class='answerBar'>";
<a href='#' class='upVote vote'>Upvote</a>
·
<a href='#' class='downVote vote'>Downvote</a>
<a class='answerTime'> $difference $periods[$j] ago</a>
</div>
<input type='hidden' name='record_id' value='$answerid[$f]' class='record_id' />
ありがとうございます。これが解決策です!私はすぐにそれを受け入れるだろう。 – kirby