Hello, I'm new to this forum and looking forward to participating.
I am practicing with jQuery and trying to write a little interaction where a user submits a word (a tag) and then it displays as a new DOM element within . However, the newTag flashes and then disappears immediately.
What am I missing>?
$("form").submit(function() {
var $newTag = $("input:first").val(); if ($newTag.length < 20) { // adds an a success alert in an empty span $("span").text("Added. Add more?").show(); $(""+$newTag+"").insertAfter("#currentTags"); return true; } $("span").text("Less than 20 characters please.").show().fadeOut(2500); return false; });