I need to be able to open a Twitter bootstrap modal window using the onClick=\"\"
or similar function. Just need the code to go into the onClick=\"\"
.
I was looking for the onClick option to set the title and body of the modal based on the item in a list. T145's answer helped a lot, so I wanted to share how I used it.
Make sure the tag containing the JavaScript function is of type text/javascript to avoid conflicts:
This function can now be called in the onClick method from inside an element such as a button: