how do I use find("node[attribute= mydynamicvalue]&quot

how do I use find("node[attribute= mydynamicvalue]&quot

Hello, this is my first post to the forum and I am really stuck. Can anybody help me out please?
I am loading an xml document and storing it in as jData. I want to find a page node by the text attribute. The attribute value is a dynamic value, so I am trying:



var keyNode = jData.find("page[text= ' " + keyNodeText + " ']");



This works if I hard code the keyNodeText string, but not when it is a variable. I have tried every variation I can think of and hours trawling the internet, but no luck.

many thanks to those of you who try to help.