I have an interating function that assigns id’s. i.e. like
$('#mycooldiv' + idNumber).text();
I’m wondering how I can take this – '#mycooldiv' + idNumber and use it within a
var div = document.getElementById('#mycooldiv' + idNumber); – because the later doesn’t work ?
I have also tried
var elem = $('#mycooldiv' + idNumber);
var div = document.getElementById(elem);
and that fails as well ?
document.getElementByIdjust need the id, the#is not needed.var div = document.getElementById('mycooldiv' + idNumber);