mirror of
https://github.com/wahyd4/jQuery-Tags-Input.git
synced 2026-08-09 21:06:43 +10:00
If interactive==true, an input will be inserted, allowing users to type new tags. If interactive==false, no input will be inserted, and tags must be added using the addTags function.
44 lines
1.1 KiB
HTML
44 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>jQuery Tags Input Test Page</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<link rel="stylesheet" type="text/css" href="jquery.tagsinput.css" />
|
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
|
|
<script type="text/javascript" src="jquery.tagsinput.js"></script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
function onAddTag(tag) {
|
|
alert("Added a tag: " + tag);
|
|
}
|
|
function onRemoveTag(tag) {
|
|
alert("Removed a tag: " + tag);
|
|
}
|
|
|
|
$(function() {
|
|
$('input.tags').tagsInput();
|
|
|
|
// Uncomment this line to see the callback functions in action
|
|
// $('input.tags').tagsInput({onAddTag:onAddTag,onRemoveTag:onRemoveTag});
|
|
|
|
// Uncomment this line to see an input with no interface for adding new tags.
|
|
// $('input.tags').tagsInput({interactive:false});
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
<header>
|
|
jQuery Tags Input!
|
|
</header>
|
|
<section>
|
|
<form>
|
|
<input id="tags_1" type="text" class="tags" value="foo,bar,baz,roffle" />
|
|
</form>
|
|
</section>
|
|
|
|
</body> |