Extract id value from css class to javascript variable

I have a ul menu from which I want to retireve certain information

<ul id=”form_builder_sortable” class=”sortable rightDiv session1″>
<li class=”draggable ui-state-highlight item id10″>Maths<button class=”delbtn”>&amp;times</button></li>

I have a function in javascript:

function getSessionDatas(){
var sessions = [];
$(‘.rightDiv’).each(function( index ) {
var session = $.trim($(this).text().slice(0,-1)).split(“×”);
var sessionData = [];
for (var i = 0; i &lt; session.length; i++) {
var s = {subjectOrder:i, subjectID:subs[session[i]]};
var ses = {sessionNo:index,sessionData:sessionData};


var s = {subjectOrder:i, subjectID:<get id here>};

I want to assign the subject id according to the class of the <li> item, in this case in the class there is an id10. How can i assign the subjectID to 10 in this case?

Tagged In :

Get help with your homework

Haven't found the Essay You Want? Get your custom essay sample For Only $13.90/page

Sarah from studyhippoHi there, would you like to get such a paper? How about receiving a customized one?

Check it out