重複の可能性:
$(document).readyの省略形
誰かが私が以下のJSコードを理解するのを手伝ってくれますか?
$(function(){ <-- Is this a JS constructor? Why we need this?
var someVariable = $(".classa").on('click', function() { <-- At what point in time does someVariable get populated?
var $this = $(this);
id = $this.attr('id');
someVariable.removeClass('selected');
});
var someVariable2 = $(".classb").on('click', function() {
var $this = $(this);
id = $this.attr('id');
someVariable2.removeClass('selected');
});
});