I have this simple jQuery code to test out.
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("text").attr("disabled","");
});
});
</script>
</head>
<body>
<input type="text">
<br />
<button>Set the textfield disabled</button>
</body>
</html>
Basically the HTML page comes with a simple button and textfield. All I want to have the input field disabled as I click the button. But it doesn't work???
(PS: this code is sourced out from w3schools.com website, just to simply test out how powerful jQuery is)
<input type="text">element? It isn't closed properly? Isn't that valid in HTML5?<input>elements never have content, so it's unambiguous.<input />like every XML element.