Hi All I'm working on a web app and I'm trying to find a specific TR using a few criteria.
To keep my code short, here's what it looks like, it's a combination of Razor and HTML but I'm trying to keep this to a minimum....
<tr id="someId" someAttribute="Attribute1" otherAttribute="Attribute2">
My jQuery looks like this:
function GetTRValue(){
var tr = $('tr[id=someID]:visible'); <-- This works great.
}
This works, and if I look in debugger I can see my attributes.
However what I am trying to achieve is to get this TR
using ID
and someAttribute
- because I want to get the value of otherAttribute
function GetTRValue(){
debugger;
var attributeValue = 'Attribute1';
var tr = $('tr[id=someID] [someAttribute=' + attributeValue + ']:visible'); <-- This doesn't work
console.log(tr);
}
I've also tried to scrape :visible all together (even thought I need to use it)
function GetTRValue(){
debugger;
var attributeValue = 'Attribute1';
var tr = $('tr[id=someID] [someAttribute=' + attributeValue + ']'); <-- This doesn't work either
console.log(tr);
}
What I'm trying to achieve is this:
function GetTRValue(){
debugger;
var attributeValue = 'Attribute1';
var tr = $('tr[id=someID] [someAttribute=' + attributeValue + ']'); <-- This doesn't work either
//By now I should have the correct tr
var otherAttribute = tr.attr('otherAttribute');
}
Anyone can provide guidance. Thanks.