First replaceWith works second doesn't
Trying to replace text in a different div on a focus and change it back on blur. The first replace works, however the second doesn't.
If I just comment out the focus then the blur works.
- <div>
<input name="form-partnership-name" type="text" id="form-partnership-name" size="45">
<script type="text/javascript">
$('#form-partnership-name').focus(function() {
$('.widgettitle').replaceWith('<h2>Random Header</h2>');
$('.textwidget').replaceWith('<p>Some other text</p>');
});
$('#form-partnership-name').blur(function() {
$('.widgettitle').replaceWith('<h2>Need Help?</h2>');
$('.textwidget').replaceWith('<p>Click here for live chat between 8am and 10 PM</p>');
});
</script>
</div>
Any help would be great!