jQuery data() returns undefined, attr() returns integer

OK. I found the problem by interpreting jQuery docs. When you write: $embellishment.data(“embellishmentId”); it is handled by jQuery as compound attribute: <div data-embellishment-id=”3″></div> So, to solve the problem you can use lower case in the data key otherwise it just addresses the different attribute. <!– HTML –> <div data-embellishmentid=”3″></div> // JavaScript $embellishment.data(“embellishmentid”);

jQuery .attr(“disabled”, “disabled”) not working in Chrome

If you are using jQuery < 1.6 do this: jQuery(“input[type=”text”]”).attr(“disabled”, ‘disabled’); If you are using jQuery 1.6+: jQuery(“input[type=”text”]”).prop(“disabled”, true); See this question: .prop() vs .attr() for references why. Or you can try this: $(‘input:text’).attr(“disabled”, ‘disabled’); see here for info on :text