I have some (invalid) HTML code which I cannot change:
<a href="#" id="text1"{some-data}>...</a>
<a href="#" id="text2"{some-other-data}>...</a>
With jQuery, I select one of the two anchors:
function someFunction(id) {
$('text'+id)...;
}
Now, I'd like to get the text inside the curly brackets. So, for id=1
this would mean some-data
, for id=2
this would be some-other-data
.
How can I do this?
To make it easy: there will be only one curly bracked thing in one element.