I am using jQuery with addClass to add class to some elements. But for some reason not all "td" get the class assigned (the ones with the .currentmonth).
$("td").addClass("aaawwwasdsad");
/
I am using jQuery with addClass to add class to some elements. But for some reason not all "td" get the class assigned (the ones with the .currentmonth).
$("td").addClass("aaawwwasdsad");
https://jsfiddle/wheelq/7Lesommm/
Share Improve this question asked Feb 14, 2016 at 20:23 meso_2600meso_2600 2,1366 gold badges26 silver badges50 bronze badges2 Answers
Reset to default 5Because other Javascript functions run later.
Look : https://jsfiddle/p9kogsmL/14/
Define it into the end of calendar function :
...
document.getElementById("calendar").innerHTML += calendarTable;
$("td").addClass("aaawwwasdsad");
}
If you want to add a class to all td ,you have to use each
loop.
here is an example:
$("td").each(function(){
$(this).addClass("aaawwwasdsad");
});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745252518a4618763.html
评论列表(0条)