Enable or Disable Progressbar with a Checkbox

The checkbox controls whether the Progressbar widget is enabled. This preserves the original use of .prop("checked") and modernizes the event binding to .on("change").

HTML Top ↑

<label>
    <input type="checkbox" id="ckb" checked>
    Enable
</label>

<div id="progress_bar"></div>

jQuery Top ↑

$( function () {
    const $bar = $( "#progress_bar" );

    $bar.progressbar({
        value: 40,
        max: 100
    });

    $( "#ckb" ).on( "change", function () {
        const enabled =
            $( this ).prop( "checked" );

        $bar.progressbar(
            enabled ? "enable" : "disable"
        );
    });
});

Video: jQuery UI Progress Bar

← Progressbar tutorial Change value with buttons →






plus2net.com






✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer