jQuery: added html JSDoc

This commit is contained in:
johnnyreilly
2014-01-01 06:45:20 +00:00
parent 2506787b09
commit 15e56b924d
2 changed files with 20 additions and 3 deletions
+1 -1
View File
@@ -1710,7 +1710,7 @@ function test_html() {
});
$('div.demo-container')
.html('<p>All new content. <em>You bet!</em></p>');
$('div.demo-container').html(function () {
$('div.demo-container').html(function (index, oldhtml) {
var emph = '<em>' + $('p').length + ' paragraphs!</em>';
return '<p>All new content for ' + emph + '</p>';
});
+19 -2
View File
@@ -783,10 +783,27 @@ interface JQuery {
*/
hasClass(className: string): boolean;
/**
* Get the HTML contents of the first element in the set of matched elements.
*/
html(): string;
/**
* Set the HTML contents of each element in the set of matched elements.
*
* @param htmlString A string of HTML to set as the content of each matched element.
*/
html(htmlString: string): JQuery;
html(htmlContent: (index: number, oldhtml: string) => string): JQuery;
html(obj: JQuery): JQuery;
/**
* Set the HTML contents of each element in the set of matched elements.
*
* @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
*/
html(func: (index: number, oldhtml: string) => string): JQuery;
/**
* Set the HTML contents of each element in the set of matched elements.
*
* @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
*/
/**
* Get the value of a property for the first element in the set of matched elements.