$("#calBox0").append(message); //calling this id"calBox3",this statesment is right;
but now,
var cal=calBox0;
$("#cal").append(message); //has errors ;
i want to know why?
<tr > //grid
<td class="calBox" id="calBox0"></td>
</tr>
$("#calBox0").append(message); //calling this id"calBox3",this statesment is right;
but now,
var cal=calBox0;
$("#cal").append(message); //has errors ;
i want to know why?
<tr > //grid
<td class="calBox" id="calBox0"></td>
</tr>
$("#cal")
here "cal" is a String it self you have to use a variable having value 'calBox0'
so use $("#"+cal)
instead of $("#cal")