Вы можете использовать libmail: http://lwest.free.fr/doc/php/lib/index.php3?page=mail&lang=en
include "libmail.php";
$m = new Mail(); // create the mail
$m->From( $_POST['form'] );
$m->To( $_POST['to'] );
$m->Subject( $_POST['subject'] );
$m->Body( $_POST['body'] );
$m->Cc( $_POST['cc']);
$m->Priority(4);
// attach a file of type image/gif to be displayed in the message if possible
$m->Attach( "/home/leo/toto.gif", "image/gif", "inline" );
$m->Send(); // send the mail
echo "Mail was sent:"
echo $m->Get(); // show the mail source
Используйте комбинацию клавиш / клавиш для переключения цвета:
$("button").keydown(function(e) {
// Sets the color when the key is down...
if(e.which === 13) {
$(this).css("background-color", "red");
}
});
$("button").keyup(function() {
// Removes the color when any key is lifted...
$(this).css("background-color", "");
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button>
Test
</button>
Попробуйте следующий код
$('.button').keypress(function(e){
if(e.which == 13){
$(this).css('background-color','#FFF');
}
});
$('.button').keyup(function(e){
if(e.which == 13){
$(this).css('background-color','');
}
});
Попробуйте это
.clicked{
background:#fff !important;
}
$('.button').keydown(function(e){
if(e.which == 13){
$(this).addClass('clicked');
}
e.preventDefault();
});
<button>
:).button
выберет любой элемент сclass="button"
– CodingIntrigue 7 March 2016 в 14:24