Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
63
rated 0 times [  64] [ 1]  / answers: 1 / hits: 71828  / 12 Years ago, wed, september 5, 2012, 12:00:00

my code



  var str =$(this).attr('id');


this will give me value == myid 5



   var str1 = myid
var str2 = 5


i want something like this ..



how to achieve this using split method


More From » jquery

 Answers
27
var str =$(this).attr('id');
var ret = str.split( );
var str1 = ret[0];
var str2 = ret[1];

[#83237] Monday, September 3, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alorac

Total Points: 262
Total Questions: 82
Total Answers: 97

Location: Libya
Member since Mon, Dec 7, 2020
4 Years ago
alorac questions
Sat, Oct 10, 20, 00:00, 4 Years ago
Tue, Sep 22, 20, 00:00, 4 Years ago
Wed, Jul 1, 20, 00:00, 4 Years ago
Wed, Jun 3, 20, 00:00, 4 Years ago
Sun, May 17, 20, 00:00, 4 Years ago
;