[英]how to retrieve the value of the star clicked in a jquery star rating
我使用的是jquery星級評分插件。鏈接為[here]( http://irfandurmus.com/projects/jquery-star-rating-plugin/ )。 這是圖像
我有一張桌子,其中一欄有星級來評價一個項目。 我正在對星級進行循環評價,以對所有行中存在的項目進行評級。我需要獲取每一行中單擊的星級的值。 但是我無法獲得每一行點擊的星號的值。 請幫我解決一下這個。
您可以使用如下形式:
$('td .rating-div').each(function(){
console.log($('.stars').find('a.fullStar.star').length);
});
您可以使用Javascript完成:
jQuery('.star').on("click", function(){
var rating = jQuery(this).attr('title');
});
其他方式
$('.rating-div').each( function() {
console.log( $(this).find('> .stars > .fullStar:last').attr("title") )
} );
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.