Как я могу удалить значение по умолчанию для входной формы onfocus с помощью jquery и очистить его снова, когда нажата кнопка отправки?
<html>
<form method="" action="">
<input type="text" name="email" value="Email address" class="input" />
<input type="submit" value="Sign Up" class="button" />
</form>
</html>
<script>
$(document).ready(function() {
//hide input text
$(".input").click(function(){
if ($('.input').attr('value') == ''){
$('.input').attr('value') = 'Email address'; alert('1');}
if ($('.input').attr('value') == 'Email address'){
$('.input').attr('value') = ''}
});
});
</script>