I’m trying to create a simple set-up so that when a certain code is entered into a form box, then a hidden element shows. If you could help me out, that’d be great. Thanks!
<form>
Enter the passcode to see the content:
<input id="pwd" type="text" name="pwd" />
</form>
<div id="content" style="display:none;">
testing 123
</div>
<script>
$function(){
$(form).keyup(function() {
$('input').trigger('change');
});
if ($('pwd').val() == supportingcauses){
$('content').show('slow');
}
};
</script>
It seems your only problem in your code is that your codes missing a bit of chars. Here’s how it should look:
I added the
#to signify its an id and the parenthesis to signifysupportingcausesis a string.EDIT
The full correct code would be:
Or as shown here: http://jsfiddle.net/nayish/MrjxY/3/