<span class="addField add">
<i class="icon"></i>Добавить
</span>
<div class="inputs">
<div>
<input type="file" name="dynamic[]" class="field" >
<span class="remove">Удалить</span>
</div>
</div>
$(document).ready(function () {
$('html').on('click','.add',function () {
$('<div><input type="file" class="field" name="dynamic[]" /><span class="remove">Удалить</span></div> ').fadeIn('slow').appendTo('.inputs');
});
$('html').on('click','.remove', function () {
$(this).parent().remove();
});
});
<?php
\Bitrix\Main\Loader::includeModule('highloadblock');
$hlBlockId = 1;
$hlObject = \Bitrix\Highloadblock\HighloadBlockTable::getById($hlBlockId)->fetch();
$entity = \Bitrix\Highloadblock\HighloadBlockTable::compileEntity($hlObject);
$entity_data_class = $entity->getDataClass();
$newsList = $entity_data_class::getList([
'filter' => $filter,
'offset' => $nav->getOffset(),
'limit' => $nav->getLimit(),
]);
<view id="icon-figure" viewBox="0 0 30 30" />
// https://code.jquery.com/jquery-3.5.0.js
/**
* Load a url into a page
*/
jQuery.fn.load = function( url, params, callback ) {
var selector, type, response,
self = this,
off = url.indexOf( " " );
if ( off > -1 ) {
selector = stripAndCollapse( url.slice( off ) );
url = url.slice( 0, off );
}
// If it's a function
if ( isFunction( params ) ) {
// We assume that it's the callback
callback = params;
params = undefined;
// Otherwise, build a param string
} else if ( params && typeof params === "object" ) {
type = "POST";
}
// If we have elements to modify, make the request
if ( self.length > 0 ) {
jQuery.ajax( {
url: url,
// If "type" variable is undefined, then "GET" method will be used.
// Make value of this field explicit since
// user can override it through ajaxSetup method
type: type || "GET",
dataType: "html",
data: params
} ).done( function( responseText ) {
// Save response for use in complete callback
response = arguments;
self.html( selector ?
// If a selector was specified, locate the right elements in a dummy div
// Exclude scripts to avoid IE 'Permission Denied' errors
jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
// Otherwise use the full result
responseText );
// If the request succeeds, this function gets "data", "status", "jqXHR"
// but they are ignored because response was set above.
// If it fails, this function gets "jqXHR", "status", "error"
} ).always( callback && function( jqXHR, status ) {
self.each( function() {
callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
} );
} );
}
return this;
};
$("input#email").inputmask({
mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,6}][.*{1,2}]",
greedy: false,
clearMaskOnLostFocus: false,
onBeforeWrite: function (event, buffer, caretPos, opts) {
buffer.forEach(function(item, i, buffer) {
if (item == '@') {
buffer[i+1] = 'g';
buffer[i+2] = 'm';
buffer[i+3] = 'a';
buffer[i+4] = 'i';
buffer[i+5] = 'l';
buffer[i+6] = '.';
buffer[i+7] = 'c';
buffer[i+8] = 'o';
buffer[i+9] = 'm';
buffer.length = i+10;
}
});
}
});
(attr) Get the value of an attribute for the first element in the set of matched elements or set one or more attributes for every matched element.
(prop) Get the value of a property for the first element in the set of matched elements or set one or more properties for every matched element.