finding sub string in jquery code form dynamic string?

Posted by Udaysimha under jQuery on 3/14/2012 | Points: 10 | Views : 3168 | Status : [Member] | Replies : 1
Hi All,
please see my code below:

$('.all_stories_drop li').live('click',function(event){

var liname= $(this).text();
alert(liname);
var li,lisub;
li=liname.toString();

//li='storesoreteljksj'; // hard code
lisub=li.substring(0,5);
alert(lisub);
alert(liname);
$('#imgallstores').text(liname);
$('.all_stories_drop').slideToggle();

});

in the above function i am getting the text of drop down list which is clicked,after that i trying to finding sub string from that. but i not able to get that. If i use hard code it working fine. Any help wouled be appriciated

uday


Responses

Posted by: Patel28rajendra on: 3/22/2012 [Member] Starter | Points: 25

Login to post response