using jQuery, I'm trying to see if a random id ends with a certain string using the following pseudo code:
var node = $('#foobar');
if (node.attr('id').endsWith('bar')) {
// do stuff
}
I know for node selection you can go $(id?='bar')
, but I need something that works for $.attr()
.
Any ideas?