質問

Suppose I get 3 attributes:

var uid = $("#main_container").attr("uid");
var ticker = $("#main_container").attr("ticker");
var exchange = $("#main_container").attr("exchange");

I want to get the anchor tag that matches those 3 attributes. I'm not sure how to do that with regards to where to put the quotes. Would it be:

$('a[uid='+uid+'][ticker='+ticker+'][exchange='+exchange+']')

or

$('a[uid="'+uid+'"][ticker="'+ticker+'"][exchange="'+exchange+'"]')
役に立ちましたか?

解決

I think it is just that you have missed the parenthesis(used <> instead of ())

$('a[uid="' + uid + '"][ticker="' + ticker + '"][exchange="' + exchange + '"]')
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top