javascript - how to get href value in <a> tag using jQuery -


inside html source code, there's <a> tag href attribute, want whatever has after second slash after individuals in case 22284494. exact tag is:

<a href="/individuals/22284494" class="i-photo">

how do using jquery?

something target anchor, attribute, split on / , last part

var numb = $('a.i-photo').attr('href').split('/').pop(); 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -