You're also missing the closing bracket ]
so you want it to parse as:
$('.property_container[id="property_1530"]').find('.login_container');
Which can actually also be written as:
$('.property_container#property_1530').find('.login_container');
But we'll stick with your format and insert the number dynamically. Note
the nesting of single and double quotes.
The selector is a string. It contains lots of stuff including double quotes:
'.property_container[id="property_1530"]'
To dynamically build a string by concatenation we use the + operator:
'.property_container[id="property_' + propertyID + '"]'
Note that you're chopping up the string into two string and a variable
and reassembling it.
That gives us our final result:
$('.property_container[id="property_' + propertyID +
'"]').find('.login_container');
(Note carefully the single and double quotes.)
Good Luck!
Legally, you should have unique IDs on a page so it'd simply be:
$('#property_' + propertyID).find('.login_container');
Cheers,
.jonah
On 12/15/11 7:00 PM, Matt Quackenbush wrote:
> Hard to tell with the jumbled mess that Gmail makes of the code, but it
> appears you're missing a single quote ( ' ).
>
> var loginContainer =
> $('.property_container[id="property_"'+propertyID+').find('.login_container');
>
>
>
> On Thu, Dec 15, 2011 at 8:35 PM, Rick
> Faircloth<[email protected]>wrote:
>
>> var loginContainer =
>>
>> $('.property_container[id="property_"+propertyID+').find('.login_container')
>> ;
>>
>>
>>
>> The ID of the property_container class div is property_1530.
>>
>> I'm trying to find the div with the class "property_container"
>> (.property_container)
>> that has the id "property_1530", where 1530 is a variable, propertyID.
>>
>> I guess I could just simplify the id to be just the "propetyID" instead
>> of appending "property_", but why make it easy! :o)
>>
>> I've tried every combination I could come up with to make this work,
>> but just can't get it to do what I want. Maybe my whole approach to this
>> needs to be reworked, and will, if I can't make this work.
>>
>> Clues, anyone?
>>
>> Thanks!
>>
>> Rick
>>
>>
>>
>>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349185
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm