skip to Main Content

Javascript – How can I close the dropdown programmatically on button click?

I have the below Bootstrap 5 dropdown menu of labeled checkboxes, with data-bs-auto-close="outside", so that the menu closes on outside click. <div class="dropdown"> <button type="button" class="btn btn-success dropdown-toggle" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false"> Dropdown button </button> <div class="dropdown-menu"> <div class="px-1"> <input class="form-check-input"…

VIEW QUESTION

Javascript – HTML canvas: additional stroke after restore

Consider the following piece of code (test it yourself): function draw() { var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); ctx.beginPath(); ctx.arc(75, 75, 50, 0, Math.PI * 2, true); // Outer circle ctx.stroke(); ctx.moveTo(75, 75); ctx.save(); ctx.setLineDash([3, 3]); ctx.lineTo(90, 90);…

VIEW QUESTION
Back To Top
Search