Looking to make my Bootstrap toggle buttons dynamic instead of static by loading them at runtime. Here is the HTML code I've been using:
<a>
Test-Title
<input checked data-onstyle="success"
data-toggle="toggle" id="myToggleID" onchange="toggleElement(this.id)"
type="checkbox">
</a>
How can I achieve this using JavaScript? I attempted:
var input = $('input[type="checkbox"]').bootstrapToggle();
but encountered the error message:
Uncaught TypeError: $(...).bootstrapToggle is not a function
I've searched for solutions to this problem without success.