mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-25 11:11:46 +08:00
Merge pull request #1490 from johnnyreilly/master
jQuery: added html JSDoc
This commit is contained in:
@@ -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>';
|
||||
});
|
||||
|
||||
Vendored
+19
-2
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user