Get a part of a class name


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var classes = $(".item").attr("className").split(" ");
  2. for(var i = 0; i < classes.length; i++){
  3. if(classes[i].substr(0,3) == "id-"){
  4. var theId = parseInt(classes[i].split('id-')[1]);
  5. }
  6. }

URL: http://groups.google.com/group/jquery-en/browse_thread/thread/712929ba52f18775

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.