0

I'm making a flask website with bootstrap styling and I have a form with some radio style buttons (made with <input> html tag). I've been trying to call a js function through onclick="" but for me it only seems to work with real buttons (<button> tags). Here's my code.

<label id="multiBot" class="bsstyle" data-toggle="collapse" href=".multi-collapse">
   <input type="checkbox" name="multis" checked autocomplete="off" id="mult" value="Mults" onchange="canvititol()"> Text
</label>
Rusca8
  • 533
  • 4
  • 11

1 Answers1

0

Okay, I found that I can make it work just by changing onclick="" for onchange="".

Rusca8
  • 533
  • 4
  • 11
  • Also it may have to do with refreshing the cached data (Cmd+Shift+R in mac), which apparently is also a thing (https://stackoverflow.com/questions/11474345/force-browser-to-refresh-css-javascript-etc). For me onclick doesn't work either, but onchange sometimes gets stuck and this solves it. – Rusca8 Mar 18 '20 at 08:45