here i am trying to get the idea about how next works.Here i am trying to show a hidden textarea on click a span element.The hidden textarea is the immediate next sibling of the span element.But seems it is not working .I am getting the following error:
ReferenceError: $ is not defined
<html>
<head>
<style>
.customcmntform{
display:none;
}
#customcomment{
color:blue;
cursor:pointer;
text-decoration:underline;
}
</style>
<script src='jquery/jquery.js'></script>
</head>
</body>
<div class='customcmntholder'></div>
<span id='customcomment' class='cmnt' onclick='letmecomment(event);'>Add a Comment...</span>
<form action='<?php echo $_SERVER['PHP_SELF']; ?>' method='post' name='cmntform'>
<textarea class='customcmntform' placeholder=' add a comment......' >
</textarea>
</form>
<script>
function letmecomment(event){
var cmnt=event.target;
var area=$(cmnt).next('.customcmntform');
$(area).show();
}
</script>
</body>
</html>