I have this HTML:
(我有这个HTML:)
<input type="text" name="textField" />
<input type="submit" value="send" />
How can I do something like this:
(我该如何做这样的事情:)
I tried something like this:
(我尝试过这样的事情:)
$(document).ready(function(){
$('input[type="submit"]').attr('disabled','disabled');
$('input[type="text"]').change(function(){
if($(this).val != ''){
$('input[type="submit"]').removeAttr('disabled');
}
});
});
…but it doesn't work.
(…但这不起作用。)
Any ideas? (有任何想法吗?)
ask by kmunky translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…