mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 15:45:13 +00:00
16 lines
321 B
JavaScript
16 lines
321 B
JavaScript
var Promise = require('../../utils/promise');
|
|
|
|
/**
|
|
Edit all elements matching a selector
|
|
*/
|
|
function editHTMLElement($, selector, fn) {
|
|
var $elements = $(selector);
|
|
|
|
return Promise.forEach($elements, function(el) {
|
|
var $el = $(el);
|
|
return fn($el);
|
|
});
|
|
}
|
|
|
|
module.exports = editHTMLElement;
|