0
Ich bin völlig neu in Javascript und ich habe eine Frage über die Auswahl Bibliothek. Wie kann ich etwas zur Liste hinzufügen und auswählen?Artikel zur Auswahl hinzufügen
{% block head %}
<link rel="stylesheet" href="{% static 'plugins/selectize/dist/css/selectize.default.css' %}">
<script type="text/javascript" src="{% static 'plugins/selectize/dist/js/standalone/selectize.js' %}"></script>
<script type="text/javascript">
$(function() {
var options=[
{value:0, text:"option 0"},
{value:1, text:"option 1"},
{value:2, text:"option 2"},
{value:3, text:"option 3"},
];
$('show_something').selectize({
plugins: ['remove_button', 'restore_on_backspace'],
options: 'options'
});
});
</script>
{% endblock %}
{% block content %}
<form method="post">
<label>whatever
<show_something></show_something>
</label>
Und ich kann nichts damit machen. Und ich muss option 0
und option 1
standardmäßig auswählen und Möglichkeiten haben, option 2
und option 3
zu wählen.
Ich kann keine Informationen finden, wie man das einfach macht.