The problem is that your id
attribute has a value with .
inside it.
Since .
a CSS selector for class names, jQuery will look for an item that has an ID location
and the CSS classes state
and id
, instead of an element with the ID location.state.id
.
You must use the \\
before the .
to use them in a query selector (in CSS, only \
would be good):
$('#d1').find('location\\.state\\.id').prop('disabled', true);
Quoting jQuery API
To use any of the meta-characters (such as
!"#$%&'()*+,./:;<=>?@[\]^``{|}~
) as a literal part of a name, it must
be escaped with with two backslashes: \\
. For example, an element with
id="foo.bar"
, can use the selector $("#foo\\.bar")
.