Can anyone explain to me why this piece of code does not work in Eclipse. I tried to compile the code on this site http://jsfiddle.net and it's work.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> $(document).ready(function () { var checkbox = $('#checker'); var dependent = $('#day_number'); if (checkbox.attr('checked') !== undefined){ dependent.show(); } else { dependent.hide(); }
checkbox.change(function(e){
dependent.toggle();
});
});
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<input type="checkbox" id="checker"><br>
<input type="text" id="day_number">
</body>
</html>
Aucun commentaire:
Enregistrer un commentaire