I have an html block like this:
<div class="main">
<div class="content">
<h3><a href="/dir/dir/dir/?id=33" title="name">name</a></h3>
<a href="/dir/dir/dir/?id=33" title=""><img src="/default.png" alt="name" /></a>
</div>
</div>
I need to catch the id
value (here 33) from the first <a href>
tag.
My code is:
function getID(s){
var s = $(this);
var a = s.('a:first').attr('href').split('=');
console.log a[1];
}
However console.log is returning me:
Uncaught SyntaxError: Unexpected token (
any idea?