diff --git a/Definitions/jquery-1.8.d.ts b/Definitions/jquery-1.8.d.ts index 1108807ed2..8b0a0aab23 100644 --- a/Definitions/jquery-1.8.d.ts +++ b/Definitions/jquery-1.8.d.ts @@ -344,7 +344,7 @@ interface JQuery { html(htmlString: string): JQuery; html(): string; - prop(propertyName: string): string; + prop(propertyName: string): bool; prop(propertyName: string, value: any): JQuery; prop(map: any): JQuery; prop(propertyName: string, func: (index: any, oldPropertyValue: any) => any): JQuery; diff --git a/Tests/jquery-tests.ts b/Tests/jquery-tests.ts index a5d3924dbf..ad386401e3 100644 --- a/Tests/jquery-tests.ts +++ b/Tests/jquery-tests.ts @@ -689,7 +689,7 @@ function test_children() { var len = $kids.addClass("hilite").length; $("#results span:first").text(len.toString()); - $("#results span:last").text(e.target.tagName); + //$("#results span:last").text(e.target.tagName); e.preventDefault(); return false; @@ -765,7 +765,7 @@ function test_closest() { }); var $listElements = $("li").css("color", "blue"); $(document).bind("click", function (e) { - $(e.target).closest($listElements).toggleClass("hilight"); + //$(e.target).closest($listElements).toggleClass("hilight"); }); } @@ -902,6 +902,22 @@ function test_each() { }); } +function test_prop() { + var $input = $(this); + $("p").html(".attr('checked'): " + $input.attr('checked') + "
" + + ".prop('checked'): " + $input.prop('checked') + "
" + + ".is(':checked'): " + $input.is(':checked')) + ""; + $("input").prop("disabled", false); + $("input").prop("checked", true); + $("input").val("someValue"); + $("input[type='checkbox']").prop("checked", function (i, val) { + return !val; + }); + $("input[type='checkbox']").prop({ + disabled: true + }); +} + function test_text() { var str = $("p:first").text(); $("p:last").html(str);