I need help with my code... I try to make some simple schedule with popus.\[code\] <div class="schedule"> <div class="single empty" rel="popover" title="Some title"></div> <div class="single empty" rel="popover" title="Some title"></div> <div class="single empty" rel="popover" title="Some title"></div> ... </div>\[/code\]So when you click on empty box in schedule, popup with subjects shows. Then, each of subjects have button with action as below:\[code\]<div style="margin: 5px; clear: both;"> <div class="input-append"> <span class="add-on" style="width: 130px;">Some name</span> <button class="btn" type="button" onclick="putSubject(id)">Add</button> </div></div>\[/code\]Function putSubject() should check if clicked prevorious box has id=active, and add some data in for clausure, but it does'nt work...\[code\] function putSubject(id) { if($(".schedule .single").attr("id") == "active") { for(var j=0;j<subjectsMap.length;j++) { if(subjectsMap[j]["id"] == id) { var sub = subjectsMap[j]["subjectname"]; var group = subjectsMap[j]["group"]; if(group == undefined) group = ""; var room = subjectsMap[j]["room"]; var rooms = room.split(","); $(".single#active").html('<div class="subjectBox"><div class="single"><div class="close" data-dismiss="subjectBox">x</div><div class="clearfix"></div><div class="boxSubject">'+sub+'</div><div class="clearfix"></div><div class="boxGroup">'+group+'</div><div class="boxRoom"><select class="span2" id="rooms"></select></div></div></div>'); for(var r=0; r<rooms.length;r++) { $("#rooms").append('<option>'+rooms[r]+'</option>'); } } } } } \[/code\]Please help me