Reputation: 41
I'd like the 'Answer' text to fade in.
<div id="div1" style="cursor: pointer;">Reveal</div>
<script>
$("#div1").click(function () {
$('#div1').fadeOut(1000,function(){ $(this).replaceWith("<span>ANSWER HERE</span>" ); });
});
</script>
Upvotes: 0
Views: 241
Reputation:
I have corrected my answer now please check this out.
$(document).ready(function() {
$("#div1").click(function() {
$(this).hide();
$(this).text("finaly it answered .................");
$(this).fadeIn(2000);
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="div1" style="cursor: pointer;">Reveal</div>
Upvotes: 1