I'm kinda new to this and I'm trying to do a simple calculation in jQuery, but it doesn't work. Can someone help me please? Thank you, This is my improved code, i added your tips, but still doesn't work (doesn't do anything):
<!DOCTYPE html>
<html lang="en"/>
<head>
<title>Seconds</title>
<meta charset="utf-8"/>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
Years <input type="value" name="secs" id="secs"><br>
<input id="sub" type="submit" value="Submit">
<script type="text/javascript">
$(function(){
$('#sub').click(function(){
var years = $('#secs').val();
var secs = years * 365 *24*60*60;
$('body').append( '<p>You have' + secs + 'of life</p>' );
});
})
</script>
</body>
</html>