mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-17 19:21:23 +03:00
docs: switch to fenced codeblocks (#31806)
This commit is contained in:
@@ -129,10 +129,10 @@ Add `data-toggle="button"` to toggle a button's `active` state. If you're pre-to
|
||||
|
||||
You can create a button instance with the button constructor, for example:
|
||||
|
||||
{{< highlight js >}}
|
||||
```js
|
||||
var button = document.getElementById('myButton')
|
||||
var bsButton = new bootstrap.Button(button)
|
||||
{{< /highlight >}}
|
||||
```
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
@@ -163,10 +163,10 @@ var bsButton = new bootstrap.Button(button)
|
||||
|
||||
For example, to toggle all buttons
|
||||
|
||||
{{< highlight js >}}
|
||||
```js
|
||||
var buttons = document.querySelectorAll('.btn')
|
||||
buttons.forEach(function (button) {
|
||||
var button = new bootstrap.Button(button)
|
||||
button.toggle()
|
||||
})
|
||||
{{< /highlight >}}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user