| `$().alert('close')` | Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed. |
| `$().alert('dispose')` | Destroys an element's alert. |
-{% highlight js %}$(".alert").alert('close'){% endhighlight %}
+{% highlight js %}$('.alert').alert('close'){% endhighlight %}
### Events
{% highlight js %}
$('#myAlert').on('closed.bs.alert', function () {
- // do something…
+ // do something...
})
{% endhighlight %}
Add the `readonly` boolean attribute on an input to prevent modification of the input's value. Read-only inputs appear lighter (just like disabled inputs), but retain the standard cursor.
{% capture example %}
-<input class="form-control" type="text" placeholder="Readonly input here…" readonly>
+<input class="form-control" type="text" placeholder="Readonly input here..." readonly>
{% endcapture %}
{% include example.html content=example %}
All methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior):
{% highlight js %}
-$('#myModal').modal() // initialized with defaults
-$('#myModal').modal({ keyboard: false }) // initialized with no keyboard
-$('#myModal').modal('show') // initializes and invokes show immediately
+$('#myModal').modal() // initialized with defaults
+$('#myModal').modal({ keyboard: false }) // initialized with no keyboard
+$('#myModal').modal('show') // initializes and invokes show immediately
{% endhighlight %}
Each plugin also exposes its raw constructor on a `Constructor` property: `$.fn.popover.Constructor`. If you'd like to get a particular plugin instance, retrieve it directly from an element: `$('[rel="popover"]').data('popover')`.
You can change the default settings for a plugin by modifying the plugin's `Constructor.Default` object:
{% highlight js %}
-$.fn.modal.Constructor.Default.keyboard = false // changes default for the modal plugin's `keyboard` option to false
+// changes default for the modal plugin's `keyboard` option to false
+$.fn.modal.Constructor.Default.keyboard = false
{% endhighlight %}
## No conflict
{% highlight js %}
var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
-$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the Bootstrap functionality
+$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the Bootstrap functionality
{% endhighlight %}
## Version numbers