Каждый ярлык для атрибута сопоставляется с вложенными флажками id .После настройки вы можете обновить все элементы, используя componentHandler.upgradeAllRegistered();
за один раз.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>My Example</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
</head>
<body>
<!-- TEMPLATE -->
<templates style="display: none">
<div id="checkbox-template">
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="podcast-checkbox">
<input type="checkbox" id="podcast-checkbox" class="mdl-checkbox__input" />
</label>
</div>
</templates>
<!-- List -->
<div id="my-list"></div>
<!-- Scripts -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<script>
$(window).on('load', function() {
for (var i = 0; i < 5; i++) {
var newItem = $("<div>");
newItem.html($("#checkbox-template").html());
newItem.find("#podcast-checkbox-container").attr("for", "the-item-" + i);
newItem.find("#podcast-checkbox").attr("id", "the-item-" + i);
newItem.find("label").attr("for", "the-item-" + i);
newItem.appendTo("#my-list");
}
componentHandler.upgradeAllRegistered();
});
</script>
</body>
</html>