-
[jQuery] each function(for 대신 $(대상이 되는 selector).each)컴퓨터/jQuery 2020. 2. 4. 19:38
* do something for every element returned from selector
$(document).ready(function(){ $('#items').on("click", function(){ $('.progress-bar').each(function() { var randomPct = Math.round(Math.random() * 100); $(this).attr("aria-valuenow", randomPct); $(this).css("width", randomPct = "%"); $(this).text(randomPct); }) }) })
'컴퓨터 > jQuery' 카테고리의 다른 글
$(function(){}) vs window.onload (0) 2020.02.09 [jQuery mobile] 설정 (0) 2020.01.29 [jquery mobile] toolbar (0) 2020.01.29 [jquery mobile] 컴포넌트, page, 멀티페이지 템플릿, dialog (0) 2020.01.29 [jquery mobile] 01 (0) 2020.01.29