each and this not working?
why does this not work? it says undefined. If i do $('input').val(); outside of the each then it will work its like the $('this') is not working. Please help.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="wrapper">
<form action="">
<label for="tags">Enter Some Tags, Bro.</label>
<input type="text" value="wer" />
<input type="text" class="tags" value="asdf" />
</form>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="tags.jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('input').each(function(){
alert($('this').val());
});
});
</script>
</body>
</html>