jQuery, same function for multiple ids
Instead of
$('#d,d2,d3')
use $('#d, #d2, #d3')
and for the if statement use $(this).val()
Remove Duplicates from JavaScript Array
Quick and dirty using jQuery:
var names = ["Mike","Matt","Nancy","Adam","Jenny","Nancy","Carl"];
var uniqueNames = [];
$.each(names, function(i, el){
if($.inArray(el, uniqueNames) === -1) uniqueNames.push(el);
});
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。