Bug in Effects - hide ()
I create 3 buttons in my test codes. I find a bug. "Change" will not work after clicking "hide".
Steps to re-produce the bug:
- Click "hide"
- Click "show"
- Type sometings, click "change". But it does not work.
Please refer to my codes.
<html>
<head>
<script src="jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#hide").click(
function(){
$("#op").hide();
}
)
$("#show").click(
function(){
$("#op").show();
}
)
$("#change").click(
function(){
$("#out").html($("#in").val());
}
)
}
)
</script>
</head>
<body>
<input type="button" id="hide" name="send" value="hide" />
<input type="button" id="show" name="send" value="show" />
<input type="button" id="change" name="change" value="change">
<div id="op">
<textarea id="in" rows="10" cols="100"></textarea>
<textarea id="out" rows="10" cols="100"></textarea>
</div>
</body>
</html>
That is an interesting issue. For me it occurs in FF, but not IE. It looks very much like a bug in FF. A very easy workaround is to use val both times, that is, to both get and set the values. This is also more consistent with other form fields.