I have this container:
<Div id="ListContainer">
I append these data to it :
' <a class="lesson" subjectID="'+sbj_ID+'"><b>
<span class="lesson_subject">' + sbj_Name + '</span></b></a> ';
I want to put the value of sbj_ID & sbj_Name in a variable.
localStorage['SubjectID']= "value of sbj_ID";
localStorage['SubjectName']="value of sbj_Name";
But I can't access them.
I tried :
$('#ListContainer').find('.lesson').attr('subjectID')
$('#ListContainer .lesson').children[0].getAttribute('SubjectID')
$('#ListContainer .lesson').children[2].innerHTML;
But they didn't work.