edward edward - 1 year ago 57
Javascript Question

I need to get a certian part out of a string using Jquery

I need to get the

part out of the following elements alt attribute

<img src="http://www.test.com" class="img-thumbnail" alt="John Smith (jsmith)">

So I'm running this


which gives me

"John Smith (jsmith)"

I need to get the 'jsmith' part out

any ideas?

Answer Source

Try this


Please note that this will only work if you want to get the text inside brackets. FIDDLE. Hope this helps

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download